From the very beginning of the Church's life, disputes arose among her members. First the Apostles then, after them, the bishops had to find ways to resolve these disputes. Unresolved disputes only fester. Throughout the millenia of the Church's life, then, the various ways in which disputes were in fact resolved gave birth to norms and procedures incorporated into what is known today as "Canon Law." This law, which is constantly developing, has always been intended to ensure that the Catholic community is properly organized. Proper order favours the mutual and complementary good of all members of the Church and so keeps her fit for the mission entrusted to her by Christ - to preach the Gospel to all creation. Canon Law is thus intended to ensure that each member’s rights and duties are protected, promoted and enforced. Properly coordinated, the rights and duties of each member of the Church converge in the common good of the whole Church. This common good is not merely some kind of social contract or collective well-being, but the very salvation of souls.
So there have to be effective and consistent ways to fix disputes, e.g., fraternal correction, monitions, mediation, etc.. Sometimes, though, a formal investigation by one or more ecclesiastical Judges into the causes and merits of a dispute is required. The Judges then come to a decision which is binding on all parties in accordance with the law.
A Tribunal [literally, a "three-in-one"], like any court of civil law, is where such disputes are processed and resolved. While the term "Tribunal" also refers to the physical building, it refers more properly to the Court of three Judges who hear and decide a case [there are instances when a Court is composed of a single judge]. In theory, every diocese has the right to have its own Tribunal, as was actually the case in Scotland up until 1970. But constraints of personnel and resources led the Bishops of Scotland of the time to establish an Interdiocesan Tribunal for the whole of Scotland. It is Scottish because located in Scotland; it is Catholic because it pertains to and is ruled by the Canon Law of the Catholic Church. It is Interdiocesan because the bishops of the dioceses concerned have agreed to assign to one single Tribunal all judicial cases which arise in their individual jurisdictions.
Among the disputes which can arise, and which require a "judicial process" [ie. a procedure under the direction of the Judge], there is the contention that the bond of marriage is, in a particular case, invalid. Since the essential rights and duties of marriage all stem from that bond, its invalidity or nullity would mean that the "contract" of marriage was not actually and effectively concluded at the moment of consent. Hence, neither the rights nor duties stemming from it were actually and effectively assumed, even if they were ceremonially assumed in good faith and with the best of intentions, at the moment of consent.
Consequently, because marital consent turns out to have been invalid this does not necessarily mean that a party entered into marriage with bad intentions. Nor does it mean that everything the couple then accomplished together from their wedding day forward was of no value. Neither the invalid marriage nor the judicial investigation into a marriage necessarily refers, of itself, to the moral integrity of a party, to their subjective will, intentions or resolutions. Rather, it refers to a fundamental and objective deficiency in the consent given which, should it be legally proven, means that something essential to the birth of the marriage bond was in fact missing at the very moment consent was exchanged. It is the provable and objective existence of this deficiency, and only this, which is the object of the investigation.
For its part, the Tribunal investigates the alleged invalidity through the judicial process of the Church's canon law. If, at the end of that process, the verdict reached finds for invalidity, then the Tribunal issues a declaration of nullity (commonly known as "an annulment"). If not, then the validity of the bond is upheld. In either eventuality, a party can impugn or challenge the outcome in accordance with the law. Great care is taken - which can at times cause some understandable frustration - to ensure that the procedure is as scrupulously observed as possible. This is done out of solemn respect for the divine institution of marriage, for the dignity of the parties to the marriage, for their marital rights and duties and, more broadly, for the common good of the whole Church.
Apart from marriage nullity disputes, and precisely because it is a Tribunal, other types of dispute [eg. to vindicate a person's rights in the Church; to investigate and pronounce on crimes committed in the Church] can come before it for a judicial decision.