Mexico only won because the French pulled out right when the American civil war ended as they valued relationships with the US over imperial Mexico. Another note is this is a precursor event for the coup of 1872 which set Mexico back even further and ended in a bloody revolution that happened in the early 20 the century. France was winning the war and Mexico only won because of Frances withdrawal..