There was any substancial opposition? What about the internationalist parties, such as Communist Party?
The short answer is because PRI controlled just about every single part of the political life in Mexico, which means that in order to have a successful career in Mexican politics, it needed to be through PRI. In what it is referred to as “La Dictadura Perfecta” (the perfect dictatorship), PRI became to symbolize the Mexican political establishment. While there was certainly opposition, primarily the PAN, one of the earliest institutionalize opponents of PRI, most of the opposition was suppressed often with very violent means. However, contrary to other Latin American countries, the suppression was never openly acknowledge as politically motivated by the ruling institutions. Even in modern times, as countries like Argentina or Peru or Chile are undergoing reconciliatory movements, Mexico still has not face their politically violent suppression of opposing forces. Also, historically PRI underwent several movements in the political spectrum to hegemonically encompass other portions of the civil society to remain relevant and hold to power. For example, if you look at its beginnings, PNR, the previous party that gave rise to PRI, came out of leftist movements encompassing labor and agrarian parties to push for progressive reforms. Then, it shifted more towards the center after it solidified power and became THE Mexican state. Then it move more towards the center right, which it still is, in a way to favor worldwide economic policies towards economic transnationalism and neoliberal corporatism.
Now in terms of PRI lost of total control, it has to do with Mexican civil society becoming more and more politically organized, and PRI loosening its repressive grips. Along these lines, fragmentation within PRI and corruption also helped weaken its political presence. Especially, when Cuauhtémoc Cárdenas broke apart from the party and created PRD, he rallied around him most of the centrist and leftist, which in turn it caused PRI no longer being able to appeal to the wide enough audience as it had done in the past. Cárdenas’s effective challenge against PRI caused the PRI candidate Salina de Gortari to openly steal the elections creating further distrusts among the population. Then, further internal crisis like the killing of presidential candidate Colosio and PRI president Ruiz Massieu created the unrest that let to PRI’s downfall.
PRI rule was maybe the best example of a successful big tent patronage based political machine. In practice it had no political ideology and was able to accommodate a huge range of policies. Members and member groups included interests you would expect to oppose each other, such as labor unions and business leaders, landowners and tenant farmers, etc. The historical reason for this is that it was formed in the immediate aftermath of the disastrous Mexican Revolution as an umbrella party that sought to include everyone with any kind of real power base. These people were happy to participate in any government as long as they a) had a voice in it and b) it could keep the war from re-igniting.
Opposition groups only formed around ideologues who were unwilling to compromise, such as hardline Communists and (especially) reactionary Catholics.
This model for governance was very successful at stopping armed revolts and military coups (compare the history of other Latin American countries in the same period).
So if the system is so stable, how did it collapse?
There are two important factors to this. The first is that as the nation's economy developed, a middle class emerged that felt cut out of what was essentially government by compromise between the landowners and big business at the top and workers and tenant farmers at the bottom. This disaffected middle class flocked to the National Action Party (PAN), originally a clericalist Catholic party with a weird, mystical quasi-Fascist philosophy which softened its more authoritarian and reactionary proposals under the influence of its new supporters, which in turn helped it attract more supporters in a positive feedback loop, eventually becoming the mainstream center-right party it is today.
The second factor is the internal collapse of the PRI. When the party selected the right wing, Harvard-trained economist Carlos Salinas de Gortari as its candidate for the nation's Presidency, the left essentially seceded and formed the PRD under Cuauhtemoc Cardenas, a popular center-left politician who was also the son of former President Lazaro Cardenas.
Salinas de Gortari's Presidency is pretty universally considered a disaster in Mexico today. NAFTA destroyed much of national industry, corruption is generally viewed as having exploded under him, and public education and health care were gutted, all in the name of market reforms and cost-cutting. The PRI therefore lost much of its popular support, which it has yet to recover.