Petroleos Mexicanos, the state oil company, is seen by most Mexicans as a blessing but at times a curse to the nation -- a proud symbol of identity, but also of mismanagement, impunity and corruption.

And Andres Lopez Obrador, who is expected to win by a comfortable majority in Mexico's July 1 presidential election, is the quintessence of Mexico's love-hate relationship with Pemex.

He emerged as a radical star of the national political firmament in the 1990s when he led fishermen and peasant farmers in blockades of Pemex refineries. The protesters claimed that Pemex activities were threatening their livelihood. In those days, there were almost no bounds, environmental or otherwise, to the powers of Pemex.

While rallying the protesters, Lopez Obrador revered Lazaro Cardenas, the president who founded Pemex by the nationalization of the U.S. and British oil companies, and he regards Cardenas as one of the greatest of Mexican heroes. Lopez Obrador defended the state monopoly until the last nail in its coffin was hammered in by the 2013-14 energy reform.

If Lopez Obrador does become president of Mexico -- and that seems highly likely -- he will at the same time be the uber-boss of Pemex, appointing and replacing the CEO every couple of years or so, and supervising Pemex strategy.

That is how Pemex works, and it does so because, unlike Colombia's Ecopetrol and Norway's Equinor ASA (formerly Statoil), it is not a state company at all but a state agency. That is exactly what Pemex maintained in its defense in a U.S. court over the 1979 Ixtoc blowout that caused an environmental disaster in the Bay of Campeche and spread into U.S. waters.

These days, however, the twin roles of president and Mexico and that of uber-CEO of Pemex often clash.

One of the oracles of the Institutional Revolutionary Party (PRI) once said that, in politics, "la forma es fondo" ("form is content"). In other words, rituals are not a mere formality but what makes you tick in politics. 

And that has been the case for President Enrique Pena Nieto, the current uber-boss of Pemex, according to George Baker, the director of Mexico Energy Intelligence. Pena Nieto remains faithful to the nationalistic rituals that contradict the very reform that he engineered, Baker says.

"Every year since 1938, March 18, Nationalization Day, has been celebrated with immense enthusiasm by the Pemex hierarchy and its labor union," adds Baker, "and ln every year of his presidency Pena Nieto heads what is the maximum celebration of the old way of doing things.

"Of course there is no problem with holding the celebration, but the head of the nation should no longer preside over it. The energy reform has to generate a new narrative of the Mexican oil industry."

But whatever confusion might have arisen, the first steps that Pemex has taken under the energy reform have been in the right direction, Pablo Medina, vice president of analysis for Welligence Energy Analytics, believes. These positive steps include at least one major discovery and plans to drill 70 exploratory offshore wells in the next three years, "the biggest number in Mexican history in such a short space of time."

"Even so," Medina adds in an article for Forbes Mexico, "the reform should have provided something better by defining the role of Pemex in the 21st century."

That something should be more profitability, he reckons. Too often Pemex regards markets as of secondary importance, placing volume before value. Some 90% of Pemex fields contribute only 25% of its production, says Medina.

Other sources say there are issues of impunity and corruption. Several hundred people have lost their lives in accidents involving Pemex that have never been explained to the public.

Nor is there any coherent explanation of the abrupt removal of Emilio Lozoya as director-general of Pemex, early in 2016.

Lozoya was named by witnesses in the Odebrecht scandal in Brazil, where it was said that he received a $10 million bribe to pass on to the PRI. Such bribes were made in similar circumstances in other Latin American countries and prominent figures were punished, including former Brazil President Luiz Inacio Lula da Silva.

Lula, the most prominent Latin American politician of recent times, is currently serving a 12-year jail sentence. Lozoya has never had to respond in public to the accusations that were lodged against him.