The council that opened in Rome in December 1869 met in a papacy under pressure. The Papal States were being absorbed into a unified Italy, liberal governments across Europe were curtailing church privileges, and Pius IX had responded with a series of increasingly uncompromising documents. Against that background the definition of papal infallibility can be read as a claim to spiritual authority made precisely as temporal authority was disappearing.
The constitution Pastor Aeternus defines two things, and the second is often forgotten. It defines papal primacy of jurisdiction, an ordinary and immediate authority over every church and every believer, and it defines that the pope is preserved from error when he speaks ex cathedra to define doctrine on faith or morals for the whole church. The conditions are narrow, and the definition explicitly does not make every papal utterance infallible, a limitation the popular understanding of the doctrine routinely ignores.
The opposition was substantial and largely tactical rather than doctrinal. A minority held the definition inopportune, likely to harm relations with governments and with other Christians, and many of them left Rome before the final vote rather than record a public no against the pope. The vote carried overwhelmingly. Most of the minority submitted afterwards; a small number did not, and formed the Old Catholic churches, which retain episcopal orders and reject the definition.