When talking about the traditional M16/AR15 magazines it is important to understand the idea behind their design. Early generations of the magazines were not intended as a long lasting part of the weapon system, instead it was designed to be semi-disposable. The idea was that they were so cheap and required little material to produce that they would just be discarded after they were spent. The military had an issue with this an would force soldiers to retain the magazines and keep them in service for as long as possible, most remaining in service long after they were supposed to be discarded due to them being too worn to serve their purpose. I would say, and this isn't dramatic over-estimation, that around 80% of all malfunctions that occur with an M16/AR15 style rifle is due to a bad mag, at least in the military.
With that in mind, standard GI mags are usually good magazines, cheap and accessable. The important thing to check is the feed lips for any slight bends. These bends will induce the malfunction known as the double-feed, which is one of the most aggravating malfunctions to deal with under stress. Another good thing to look for is an anti-tilt follower which are usually orange in color versus the light green that are not anti-tilt. If you are curious and want to test if your follower is anti-tilt or not, push in on the front part of the follower to see if just the front part tilts in or if the whole follower pushes down evenly.
Now days, hands down the most popular AR-15 magazine that isn't GI surplus is the Magpul polymer magazines, a for a few good reasons. They are very durable and pretty much crush proof, pretty inexpensive these days and can come in a variety of different colors. The Magpul, however, is not indestructable as many claim as it can develop a crack down the spine which will give you the same host of isseus that you would get with the regular magazines. Also the Magpul magazines tend to be just a little thicker then their metal counterparts which means stuffing them in pouch is a little tighter fit as well as some of the higher end rifles are a little too tight for an easy fit when slapping a new Magpul magazine home.
There are plenty of other magazines on the market as well, I'll give you a quick down and dirty on. Daniel Defense makes my preferred magazine (pictured above), has a pretty robust construction, increased carry compacity with the same size profile, but it is a little more expensive. H&K made their own magazine, it's supposed to be more salt-water corrosion resistant, but it's about 10 times as expensive as a surplus magazine, isn't crush proof and is twice as heavy. Lancer also makes an expensive magazine, but these are just as slim as the metal mags, made from polymer and have metal reinforced feed lips.
At the end of the day if you feed an AR-15/M16/M4 type weapon with a bad magazine, the likelihood of you experiencing a malfunction go up exponentially. The answer isn't necessarily going out and buying the most expensive magazine on the market, because most surplus magazines will do just fine. They key is an understanding of how and why the magazines will go down, mitigation of those risks and keeping a good maintenance of the magazines; do these things and your magazines will not be the culprit for malfunctions. One other thing, if you do run into a magazine that is bent or cracked, destroy it and throw it out; my preferred method was unloading the magazine then either using it for target practice or punching a Gerber tool through it. This is especially important in the military because if the mag looks good some poor soul will likely press it back into service and could end up making a life endangering situation.