In the decade before WWII, Mexico was chaotic and unstable. The Mexican Revolution (1910-1920) which caused widespread destruction and claimed hundreds of thousands of lives was followed by several violent uprisings against the new government (Cristero War from 1926-1929). Then, during the Great Depression, the Mexican economy suffered badly.
In 1934 the reformer Lázaro Cárdenas del Rio took power and helped Mexico move toward a more stable, productive nation. Cárdenas kept Mexico neutral as conflict grew in Europe, even though Nazi and American agents vied for an alliance with Mexico. Although great outcry arose when Cárdenas nationalized Mexico’s vast oil reserves, with war clouds on the horizon, the U.S. Government and private interests were forced to accept it.
At the start of the war in Europe, the Mexican Communist Party supported Germany while the 1939 German-Soviet Non-Agression Pact was still in place. However, once Germany invaded the USSR, Mexican Communists switched allegiance to the Allies. At the other end of the political spectrum, a group of extremely conservative Catholics formed the Unión Nacional Sinarquista in opposition to Cardenas and supportive of the Axis powers.
Additionally, historical grievances with the USA ( loss of Texas and American southwest territories, U.S. intervention during the revolution and multiple incursions into Mexican territory) caused great resentment and distrust of the USA. Many Mexicans were ambivalent as to whether they should join the Axis cause against their historical U.S. antagonist, or remain neutral (thereby not providing an excuse for another U.S. invasion).
In 1940, Mexico elected the conservative (PRI- Revolutionary Party) presidential candidate Manuel Ávila Camacho who pursued a course of detente with the U.S. Although there was much initial dissent in Mexico with this policy, once Germany attacked the USSR (and Mexican Communists switched allegiance to the Allies) support for Ávila’s policies grew. After the attack on Pearl Harbor, Mexico was one of the first countries to pledge support and aid, and they severed all diplomatic ties with the Axis powers.
US capital began to flow into Mexico for industry supporting military needs. The U.S. bought Mexican oil and sent technicians to enhance Mexican mining of metals needed for wartime production (e.g., mercury, zinc,copper). Mexican armed forces were supplied with US weapons and training.
When German U-boats sank two Mexican tankers, the Potrero del Llano on 14 May and Faja de Oro on 21 May , sixteen Mexicans died. On May 21, 1942 Mexico declared war on Germany.
Like the Brazilian Infantry Division sent to Italy together with a squadron of P-47 fighter bombers; a U S equipped Mexican infantry division and fighter bomber squadron were sent to fight in the invasion of the Philippines. General Mac Arthur’s Southwest Pacific Theater Command refused to use these assets in combat.
Similarly, the U S Army 92nd Infantry Division (Colored) was deployed to Italy, and served in combat (like the Brazilian Division,) withe General Clark’s fifth Army, while the U S Army 93rd Infantry Division (Colored) saw sent to the Pacific, but was not used in combat…
Therr are numerous sources covering the history of black and minority U S ethnicity personnel in WW 2 on the inter web (Hyperwar is one comprehensive example); perhaps you you could write more about this..