The Magisterium is the official teaching authority of the Church, constituted by the Pope and the bishops in union with him. Its authority comes from Christ, and its guidance comes from the Holy Spirit.
Many of the teachings found in Sacred Scripture can be difficult to understand.
Different people—even well-educated people—can and do interpret the same passage of Scripture in very different ways. When questions regarding the teachings of Christ arose in the first years following his Ascension, the early Christians naturally turned to the Apostles for guidance. We see this very clearly when a question arose about the necessity of following the Law of Moses; the Apostles gathered in council to ensure one, uniform answer to the question (cf. Acts of the Apostles 15). They had received not only the Deposit of Faith, but also Christ's authority in the leadership of the Church, including the authority to teach. The teaching authority of the Church, or Magisterium, is intimately associated with the Deposit of Faith. (Cf. CCC 95,2049)
Although the Magisterium is charged with interpreting and applying Scripture and Tradition, it is not superior to the Deposit of Faith, but rather its servant. It can neither add to nor subtract from the Deposit of Faith; instead, it serves as its guardian, preserving and communicating these truths to every generation of believers for all time under the guidance of the Holy Spirit. Cf. CCC 86)
The teaching authority of the Church comes from Christ himself, who extended this authority to Saint Peter and the Apostles; they, in turn, have passed it down through Apostolic Succession to the Popes and bishops of every age. The Holy Spirit guarantees that the Magisterium will always teach the truth infallibly on matters of faith and morals. (Cf. CCC 2032-2033,2051)
-The Didache Bible
Apostolic succession is the transmission by means of the sacrament of Holy Orders of the mission and power of the Apostles to their successors, the bishops. Thanks to this transmission the Church remains in communion of faith and life with her origin, while through the centuries she carries on her apostolate for the spread of the Kingdom of Christ on earth.
-Compendium, CCC