Drugs are much cheaper in other countries because they take the drugs developed by American firms and duplicate them.
Drugs are like computer chips. Developing the the first pill or chip costs $1B. Thereafter they cost .05 each to produce.
Except chip companies generally don’t have to discard 50 of the chips they are developing before they return any revenue.
When you buy drugs in Mexico or elsewhere in the 3rd world, you may or may not be getting what you think you are getting. Where piracy is common, you also get a lot of counterfeiting.