Several weeks ago, this farming town on the hot Pacific flatlands went wild for a day. "Mexico is great and great is its destiny," giant billboards proclaimed on the airport road where trains and trucks lined up, blasting their horns.

Bales of cotton, sesame seed and coffee, stacked along the streets, formed a guard of honor, and the initials of the distinguished visitor had been daubed into the palm trees.

No one seemed to mind when a convoy of buses spewed their soot and diesel fumes all over the starched white uniforms of the waiting schoolchildren. And when the caravan reached the main square all the marimba bands merged into one vast tropical orchestra.

The center of this extravangaza was Miguel de la Madrid, known also as El Candidato even though four other people--three men and a woman--are also running for president of Mexico. The 47-year-old former minister of budget and planning is the candidate of the Institutional Revolutionary Party, the PRI, which has won every election since 1929, and has virtually no chance of losing the next contest scheduled for July 4.

Yet in the time-honored tradition of the PRI's attempts to demonstrate its popular support while maintaining the image of a multiparty democracy in Mexico, de la Madrid is spending eight months--with the government footing the bill--campaigning for all he is worth into the far corners of the country.

When asked about the vast expense and effort spent on such predictable election results--$200 million according to the calculations of one leftist opposition party--Mexican politicians invariably explain that it is a ritual essential for the stability of the system and hence a small price to pay.

Although Mexico has the trappings of a democracy, almost all power lies in the hands of the president. The campaign, so insiders explain, is part of the slow, peaceful transfer of power. It provides a massive briefing for the candidate on the nation's problems, gives him contact with the local political bosses and interest groups and permeates the country with the image of a man so far unknown.

Slowly, de la Madrid, the low-profile planner and manager of the nation's budget, known for his affable manner and cool judgment, is getting the image of a popular reformer--the image most Mexican presidents have sought. He is saying all the expected things about Mexico's revolution being alive and well, defending the rights of workers and peasants, promising democratic reforms and endorsing Mexico's foreign policy.

Among the image-makers are more than 100 journalists who travel on the campaign. But to insiders, the handling of the press is already straining the credibility of de la Madrid's promises to launch a strong anticorruption drive labelled "moral renovation." Press officers continue to hand out "the envelope" with cash to most reporters, a normal government practice when journalists cover official events. The "envelope" on the campaign amounts to 2,000 pesos per day--close to $90--even though the party pays all expenses during the trip.

"I"m all for de la Madrid," said a veteran political columnist who said he refused the pay. "But you can't talk about the terrible corruption and at the same time pay the press to get good coverage. It's too bad they didn't start with a clean slate."

For all its reputation of corruption and co-option, Mexico's political system has long intrigued and baffled outsiders. France's Gen. Charles de Gaulle, on a visit here, once expressed his admiration for the effective one-party formula and ordered aides to study what Gaullism could learn from it.

Many Latin Americans, used to military coups and bloodshed, wonder out loud how Mexico has maintained stability for 50 years with a civilian president acting as a virtual dictator for six years, then leaving office punctually when his time is up.

Although it uses the language of social reform, often heavily sprinkled with leftist rhetoric, the official party has no discernible ideology, but is rather a coalition of interest groups. It is at times unabashedly authoritarian, yet its dominant style is to conciliate rather than to confront at crisis time. Mexican politicians themselves have compared their party's hierarchical political structure and mysterious ways to the Roman Catholic Church or the Soviet Communist Party.

From its members it demands total loyalty, discretion and subservience to dogma or policy. Much of its strength lies in massive union control while its growing weakness, according to worried party officials, is that it has so far failed to modernize as Mexico's economy and middle classes expand rapidly.

Over dinner recently, Mexican officials were having one of those frequent debates about the secrets of the system and "how much longer can it last" when one man smiled: "It's not complicated at all, and it's here to stay. It's most like an accordion. It's totally flexible and you can play any tune. You can pull it to the left and the right. And you can play it on both sides at once. You can't go wrong."

Yet there ae signs of change. Both President Jose Lopez Portillo and the man he picked to become his successor--a presidential prerogative--have been modern managers within the bureaucracy, while in the past a president almost invariably came up through the ranks of the Interior Ministry, the nerve center of the political system here.

Another difference this year is that de la Madrid is competing with three leftist and two rightist candidates. Allowing new parties to register and guaranteeing them congressional seats is part of the political reform designed as a way to renew politics here.

The official candidate need not fear his challengers, but they can harm the government's image. Abstention has increased drastically during the past round of state elections. The small and weak opposition parties may get a large proportion of the protest vote, particularly in Mexico City.

In the high valley north of San Cristobal near Tapachula, where about 20,000 Indians appeared oblivious of a party cheerleader exhorting them in Tzotzil, one of the local native tongues, a strong murmur suddenly rippled through the crowd and turned into a wave of giggles.

De la Madrid, dressed in the long black woolen shirt, red cumberbund and white headdress of the Chamula tribal leaders beside him, had arrived. Speeches, in Tzotzil, with succesive translations into Spanish, followed. Representatives from the Zoque, Tojolabal and Mam peoples, listed their shortages of water, schools, clinics, and excess of alcohol and white exploitation in the Indian villages.

De la Madrid replied with promises and paid homage to the Indian cultures.

Before the end, many of the bystanders began to move away. A local politician reported that many of them had gone ahead to build fires and prepare food in the open fields. The party, he said, had provided the money to buy 54 head of cattle to feed the crowd.