The doctrine of papal primacy upholds the divine authority of the Successor of St. Peter to rule over the entire Church with ordinary and immediate jurisdiction. Two Magisterial texts are key to understanding its supreme nature and the obligation of all who are not invincibly ignorant of this truth to submit to Papal authority for the sake of their salvation.
Pope Boniface VIII, in his Bull Unam Sanctum (1302), spelled out the doctrine of the necessity of the Church for salvation and with it the necessity of submission to the Roman Pontiff. Regarding the primacy of authority of Peter and his successors he stated:
But this authority, although it is given to man and is exercised by man, is not human, but rather divine, and has been given by the divine Word to Peter himself and to his successors in him, whom the Lord acknowledged an established rock, when he said to Peter himself: Whatsoever you shall bind etc. [Matt. 16:19]. Therefore, whosoever resists this power so ordained by God, resists the order of God [cf. Rom. 13:2] ... Furthermore, we declare, say, define, and proclaim to every human creature that they by necessity for salvation are entirely subject to the Roman Pontiff.
As with all principles of morality, God does not hold the invincibly ignorant of the truth culpable for failing to live by them. Thus, Pope Pius IX could say regarding the salvation of those outside the Church, and thus also those who do not submit to the Roman Pontiff,
We must hold as of the faith, that out of the Apostolic Roman Church there is no salvation; that she is the only ark of safety, and whosoever is not in her perishes in the deluge; we must also, on the other hand, recognize with certainty that those who are invincible in ignorance of the true religion are not guilty for this in the eyes of the Lord. And who would presume to mark out the limits of this ignorance according to the character and diversity of peoples, countries, minds and the rest?
This same Pope convened the First Vatican Council, which in addition to defining papal infallibility also defined papal primacy. Both doctrines point the faithful to the necessity of union with the Successor of Peter. Infallibility directs our attention to the unifying role of the Pope in matters of faith, and primacy to that role with respect to sacramental and other ecclesiastical disciplines.
...all the faithful of Christ must believe "that the Apostolic See and the Roman Pontiff hold primacy over the whole world, and that the Pontiff of Rome himself is the successor of the blessed Peter, the chief of the apostles, and is the true vicar of Christ and head of the whole Church and faith, and teacher of all Christians; and that to him was handed down in blessed Peter, by our Lord Jesus Christ, full power to feed, rule, and guide the universal Church, just as is also contained in the records of the ecumenical Councils and in the sacred canons.
... the faithful of whatever rite and dignity, both as separate individuals and all together, are bound by a duty of hierarchical submission and true obedience, not only in things pertaining to faith and morals, but also in those which pertain to the discipline and government of the Church spread over the whole world, so that the Church of Christ, protected not only by the Roman Pontiff, but by the unity of communion as well as of the profession of the same faith is one flock under the one highest shepherd. This is the doctrine of Catholic truth from which no one can deviate and keep his faith and salvation... [Dogmatic Constitution on the Church, Vatican Council I, 1870]