I personally don’t agree that Mexican food in the US is particularly good on average. Maybe in certain specific border regions. But even here in Northern CA where we have a large population with Mexican ancestry, it’s fairly mediocre compared to Mexico. And it was even worse in other parts of the country I’ve had it.
That said, Mexico is one of the top culinary countries in the world in my estimation, so perhaps American Mexican food is still fairly solid despite falling short of this very high bar.
Perhaps the OP comparison is not Mexican food in the USA vs. in Mexico, but rather Mexican food in the USA vs. other food styles inside the USA? In which case Mexican is damn tasty. 😋