Actually unions are numerically irrelevant. Only 6 % of the USA workforce is unionized. There political power is way out of proportion to the number of union workers.
You’re right, it certainly not unions that account for it, but we do have exceptionally good workers. Go to Mexico City, or any resort town in Mexico and look at the quality of the construction. Look at the quality of the concrete, for example. It’s never as good as in the U.S., and sometimes it is shockingly poor. Then look at the construction workers here in the U.S. Many of them are the same workers you would see in Mexico. Why is what they produce here so much better? The best answer I can come up with is we enforce standards here, whereas in Mexico everything is subject to “mordidas” or petty bribes. Here, the concrete inspector does his job; there his job is not so much as inspect concrete, but to honor his family connections, and make as much money as he can.