What is the mechanism that allows immigrants from other central-american countries to cross Mexico to the US border? Are Mexican border controls simply lax? Or are there other considerations..?
The right to enter and leave are rights guaranteed to citizens according to Article 11 of the Constitution
Everyone has the right to enter and leave the Republic, to travel through its territory and to change his residence without necessity of a letter of security, passport, safe-conduct or any other similar requirement. The exercise of this right shall be subordinated to the powers of the judiciary, in cases of civil or criminal liability, and to those of the administrative authorities insofar as concerns the limitations imposed by the laws regarding emigration, immigration and public health of the country, or in regard to undesirable aliens resident in the country.
Article 11, Constitution of the United Mexican States, 1917 (as Amended). Washington: Pan American Union, 1961. Print.
Mexico doesn't impose exit controls on travelers, just like the US and Canada don't at their borders. Hence there is nothing legally stopping anyone from crossing into the US from Mexico without a proper visa. And Mexico has zero incentive to allow thousands of illegal immigrants to stay on their land, so they're more than happy to let the US handle the problem.
I think it is a matter of strategy, obviously is illegal to enter Mexico same as it is illegal to enter US. The Mexican government tried (and is helping the US) to stop the migrant group.
But at some point with that many people not stopping at your requests (nor using the legal stablished ways for migration and refuge requests) you have to make a decision: let them through or stop them by force, for Mexico this was an easier call than for the US because the express intent of the migrants is not to stay in Mexico but to enter to the US.
Most of these "immigrants" are in fact seeking asylum, not immigration status. As such if Mexico did try to remove them they could claim asylum in Mexico and by international convention could not be immediately refused.
So from Mexico's point of view it's better to let them pass through and claim asylum in the US.