It is widely acknowledged that much of that drug trade is destined for consumers in the United States. The guns, in turns out, are also often American in origin. As explained in the blurb of a Morning Edition radio story on the topic (part of National Public Radio):
[A] U.S. government report says 87 percent of the guns seized by authorities in Mexico's drug war are traced back to the United States. Mexican drug cartels find it much easier to obtain firearms north of the border. There are tens of thousands of licensed gun shops in the U.S. There is just one in Mexico, and it's run by the army.
While it is legal to keep small registered firearms in your home for personal defense in Mexico, and to carry hunting weapons outside your home, both types of gun possession are heavily regulated there. There are only about 7,000 guns sold legally in the country each year, but about 30,000 illegal guns seized each year there.
Obviously, the ban on guns in Mexico hasn't kept powerful firearms out of the hands of drug cartels, any more that draconian drug laws in the United States have effectively stemmed demand for drugs in the United States that impacts Mexico indirectly. The open question is whether the availability of black market guns in Mexico is really inevitable, or if it is instead the fault of the laxity of U.S. gun control laws.