From the Catechism:
874 Christ is himself the source of ministry in the Church. He instituted the Church. He gave her authority and mission, orientation and goal:
In order to shepherd the People of God and to increase its numbers without cease, Christ the Lord set up in his Church a variety of offices which aim at the good of the whole body. The holders of office, who are invested with a sacred power, are, in fact, dedicated to promoting the interests of their brethren, so that all who belong to the People of God…may attain to salvation.
551 From the beginning of his public life Jesus chose certain men, twelve in number, to be with him and to participate in his mission. He gives the Twelve a share in his authority and 'sent them out to preach the kingdom of God and to heal." They remain associated for ever with Christ's kingdom, for through them he directs the Church:
“As my Father appointed a kingdom for me, so do I appoint for you that you may eat and drink at my table in my kingdom, and sit on thrones judging the twelve tribes of Israel.”
552 Simon Peter holds the first place in the college of the Twelve; Jesus entrusted a unique mission to him. Through a revelation from the Father, Peter had confessed: "You are the Christ, the Son of the living God." Our Lord then declared to him: "You are Peter, and on this rock I will build my Church, and the gates of Hades will not prevail against it." Christ, the "living Stone", thus assures his Church, built on Peter, of victory over the powers of death. Because of the faith he confessed Peter will remain the unshakeable rock of the Church. His mission will be to keep this faith from every lapse and to strengthen his brothers in it.
553 Jesus entrusted a specific authority to Peter: "I will give you the keys of the kingdom of heaven, and whatever you bind on earth shall be bound in heaven, and whatever you loose on earth shall be loosed in heaven." The "power of the keys" designates authority to govern the house of God, which is the Church. Jesus, the Good Shepherd, confirmed this mandate after his Resurrection: "Feed my sheep." The power to "bind and loose" connotes the authority to absolve sins, to pronounce doctrinal judgments, and to make disciplinary decisions in the Church. Jesus entrusted this authority to the Church through the ministry of the apostles and in particular through the ministry of Peter, the only one to whom he specifically entrusted the keys of the kingdom.
880 When Christ instituted the Twelve, "he constituted [them] in the form of a college or permanent assembly, at the head of which he placed Peter, chosen from among them." Just as "by the Lord's institution, St. Peter and the rest of the apostles constitute a single apostolic college, so in like fashion the Roman Pontiff, Peter's successor, and the bishops, the successors of the apostles, are related with and united to one another."
881 The Lord made Simon alone, whom he named Peter, the "rock" of his Church. He gave him the keys of his Church and instituted him shepherd of the whole flock. "The office of binding and loosing which was given to Peter was also assigned to the college of apostles united to its head." This pastoral office of Peter and the other apostles belongs to the Church's very foundation and is continued by the bishops under the primacy of the Pope.
882 The Pope, Bishop of Rome and Peter's successor, "is the perpetual and visible source and foundation of the unity both of the bishops and of the whole company of the faithful." "For the Roman Pontiff, by reason of his office as Vicar of Christ, and as pastor of the entire Church has full, supreme, and universal power over the whole Church, a power which he can always exercise unhindered."
883 "The college or body of bishops has no authority unless united with the Roman Pontiff, Peter's successor, as its head." As such, this college has "supreme and full authority over the universal Church; but this power cannot be exercised without the agreement of the Roman Pontiff."
884 "The college of bishops exercises power over the universal Church in a solemn manner in an ecumenical council." But "there never is an ecumenical council which is not confirmed or at least recognized as such by Peter's successor."
889 In order to preserve the Church in the purity of the faith handed on by the apostles, Christ who is the Truth willed to confer on her a share in his own infallibility…
891 "The Roman Pontiff, head of the college of bishops, enjoys this infallibility in virtue of his office, when, as supreme pastor and teacher of all the faithful - who confirms his brethren in the faith he proclaims by a definitive act a doctrine pertaining to faith or morals....When the Church through its supreme Magisterium proposes a doctrine "for belief as being divinely revealed," and as the teaching of Christ, the definitions "must be adhered to with the obedience of faith." This infallibility extends as far as the deposit of divine Revelation itself.
936 The Lord made St. Peter the visible foundation of his Church. He entrusted the keys of the Church to him. The bishop of the Church of Rome, successor to St. Peter, is "head of the college of bishops, the Vicar of Christ and Pastor of the universal Church on earth"
937 The Pope enjoys, by divine institution, "supreme, full, immediate, and universal power in the care of souls."