In plain English, you need MQD or Spend to obtain status with Delta or United, American had it and now replaced with Loyalty Points.
MQDs usually match 1-1 with real cash spend. Airlines are pretty good at calculating how much money they make off each ticket they sell you, and what part is taxes etc. So on a $100 fare they can say you had spend of $90.
Now the issue is with partner airline, sometimes they have lots of information, otherwise they just know you flew from X to Y via Z in A class. That's great but doesn't give a full picture for them, now they could spend more to get additional information, especially with Joint Ventures but in reality it's a spend vs return on spend idea.
So to keep things simple they credit different flights at different rates based upon the booking code, with some airlines giving closer partners a higher rate.
Things get complicated easily so they generally give ranges of earnings on partners from 0% to 60% of distance as MQDs
You can earn Delta MQMs, RDMs and MQDs from at least 384 unique airfare buckets across 4 types of cabin (First Class, Business Class, Premium Economy and Economy) and subcategories within each area on over 20 different airlines!
Data as of mid 2022 from my site Premiumcabindeals
Aeromexico in Business Class gives you 40% of Distance flown as MQDs and 150% of distance as MQMs.
Using your example: IAH-MEX-TIJ-MEX-TIJ gives 5050 flown miles, which times 40% gives 2020 MQDs and 150% MQMs or 7577 MQMs. Numbers from MileCalc.