What is a "church"? The word in the Catholic context can take on several meanings. A church can be the building where fellow believers gather to worship. A church could be that group of local believers itself. Or the Church could be just one universal family of God where we are the children of God and Christ is our Big Brother. Besides worshipping our Father, it is the duty for the members of the Church to introduce our most Holy Father to nonbelievers. Since it is for this reason that Jesus established the Church, the Church can be considered an organization.
In this organization, there would be a system of believers organized in such a way that it will be able to work towards achieving its goals and at the same time be able to co-exist with the changing times (since the Church has to be able to last until the end of time). Such an important task requires two things (besides the Holy Spirit): 1> the organization must be fully united, and 2> it must have a central teaching authority. Ultimately, God is the teaching mastermind behind the Church. However, since Jesus was the authority when on earth, there must be a human representative of Him to whom people can turn after Jesus goes up to heaven. That is why the Catholic Church has a Pope. The Pope would be the earthly leader for all Christians. Of course the Pope doesn't make all decisions by himself, he also has a council of bishops to advise him. Since the apostles and disciples seem to have some authority over the regular believers as teachers of the faith, they should also have successors. All this about having representatives just shows how much we need teachers and advisors. Sure we have the Holy Spirit to guide us, but since we are physically-adapted beings, we still feel a need for a visible authority that is trustworthy and to whom we can turn on matters concerning teachings of the Church as well as knowing how to live better Christian lives. It is not good enough for us to rely on the Holy Spirit talking to us and then formulate teachings based on our own understanding. We must have an authority to do that. Otherwise, contradictions will result as clearly shown in history.
The Church must be united. It can not be split up into such denominations that don't *universally* agree on all the teachings. Clearly, the teaching Church would also be the authorized interpreter of Scripture; just like there are authorized interpreters of Mose's Law. Since the Church is universal, the teaching authority must be central; there cannot be teachings that are fundamentally different from each other. For the Catholic Church; the teaching authority is called the Magisterium. Under the guidance of the Holy Spirit, the Magisterium bases its teachings on Sacred Scripture and Sacred Tradition. It is with these that the Catholic Church teaches its members.
"What is Sacred Tradition?" one might ask. It is the same tradition that allowed the Gospel to be passed on to people from the time Christ told His disciples to "go and teach all nations" to when the printing machine was invented some 14 centuries later. It should be noted that not a lot of people in those days were literate and those who are have to pay a considerable amount of money for a copy of Scriptures since the copies had to be done by hand and such work takes at least a few years before completion. Hence, teachings were done by the mouth. Sacred Tradition is the tradition by which Jesus and His Apostles taught the people. You don't often find (if ever) Jesus walking around with Scripture scrolls tucked under His arm, opening them up and telling His disciples, "See, this is what it says in the Bible...". Another example of Sacred Tradition is the one that allowed Peter to know that Michael and Satan had fought over Moses' body (even though you don't find the event recorded in the OT which is the Bible in those days). Actually, that incident is found in a non-Scriptural (non-inspired) book called "the Assumption of Moses". Just because the book wasn't inspired doesn't necessarily mean it is false. It just cannot contradict what Scripture says. NOTE: saying something that is not found in Scripture doesn't mean a contradiction. But saying something which contradicts what Scripture *does* say is wrong. The challenge is knowing exactly what Scripture did say and what Scripture did not say. This difficulty is part of the reason why we have a teaching church.
Since Jesus promised the help of the Holy Spirit and His own accompaniment "even to the end of time", we can be sure that the doctrinal teachings of the Church are error-free and that the Church can not teach what is wrong. NOTE: just to remind you that the Magisterium is infallible only when the Church teaches ex cathedra which means "from the chair" (from the seat of Peter - just like from Moses' seat for the Pharisees). So the Magisterium cannot declare something that is wrong or false to be a doctrine. If you read the history of the Church, you find that there have been "bad" popes. But as long as the officially declared doctrines are not wrong or untrue, the Church is okay. Why, it has existed (and been unified) for nearly 2000 years despite all the conflicts within and without it!