The M-16 has a bad reputation, which it doesn’t necessarily deserve.
The M-16 replaced the M-14. The M-16 fired a smaller round, and also was lighter due to the use of a plastic stock (compared to the M-14’s wooden stock). The use of a lighter round was somewhat controversial. The lighter round won’t penetrate obstacles as well as a heavier round, but the lighter round and plastic stock meant that the soldier could carry much more ammunition. Armies care very much about logistics. The less resources you have to devote to carrying ammunition around, the more resources you have to throw into combat. For the same number of soldiers and ammunition trucks and so on, soldiers equipped with M-16s will be able to fight longer than soldiers equipped with M-14s or the enemy’s favorite AK-47.
Soldiers don’t care about logistics though (until they run out of ammo, then they care). To the soldiers, the M-16 was a cheap plastic piece of crap that didn’t have the same stopping power as the M-14 they were used to. They used to make fun of the M-16’s plastic stock, saying that it was the first combat rifle made by Mattel.
Worse, the M-16 is a fairly high precision rifle. This makes it accurate, but it also makes it vulnerable to jamming if you don’t take care of it. The AK-47, by contrast, is intentionally a much less precise weapon. The AK-47 was intentionally made of cheaper parts that required much less tolerance to manufacture. As a result, the AK-47 can be produced on less high tech equipment (so it is cheaper to make), and the AK-47, because of its loose tolerances, can tolerate a lot more dirt and gunk in it before the weapon will jam. Despite the M-16’s high tolerances, as GiantRat said it was issued to troops without cleaning kits. Soldiers were told the weapon was so reliable that it didn’t need cleaning. They quickly found out otherwise, as the weapon very often jammed in combat.
On top of all of this, there were some actual manufacturing and design problems with the early M-16s, just as you get with any new weapon.
So, it’s really not surprising that the M-16 quickly got a reputation for being completely worthless.
Over the years, they’ve made a lot of improvements. The early problems were fixed. Soldiers were issued training kits and taught to keep their weapons clean. They made some improvements to the round, so it has a bit more stopping power.
Compared to the AK-47, the M-16 costs more to produce, so you can make more AK-47s than M-16s for the same amount of money (the M-16 loses there.).
The M-16’s round, despite improvements that have been made to it, still cannot penetrate as well as the round from an AK-47. This doesn’t necessarily mean that the AK-47 wins this one, though, because the M-16’s round is still lighter, which means soldiers can carry more rounds for the same weight, and fewer ammo trucks and such are required to supply them. So this one is still controversial as to which one is better.
The M-16’s design is much better than the design of the AK-47 with respect to recoil. The M-16’s recoil pushes the rifle straight back, where the AK-47 tends to rise. When firing on automatic, the M-16 is much easier to keep on target. The AK-47 will tend to creep up as you shoot.
The M-16 is much more prone to jamming than the AK-47 (though the AK-47’s resistance to jamming and tolerance for dirt and crap is often very much over-exaggerated). However, the M-16 is also much more accurate. The AK-47’s sloppy tolerances mean that the entire weapon shakes and moves as it shoots. If you are in Iraq and there’s a bunch of insurgents hiding in a building, the AK-47 might be able to punch through the wall and kill them when the M-16 under the same conditions might not be able to. On the other hand, if you’ve got an insurgent a block away shooting at you from a rooftop, the AK-47 isn’t very likely to hit him, where the M-16 is much more likely to be ale to pick him off. So, the higher precision of the M-16 is again controversial, and you can argue either way whether the M-16 or the AK-47 is more accurate. For close up fighting, soldiers often prefer the heavy punch of the AK-47. At longer ranges, the AK-47 is reduced basically to spray and pray type fighting, which wastes a lot of ammunition (which again, soldiers can’t carry as much of it for the AK-47) and isn’t as likely to take out the enemy.
For what it is designed to do, the M-16 is a very good weapon. Whether it is better or worse than the AK-47 is a matter of opinion, and depends on how you weigh the various factors of what an M-16 is better at vs. what an AK-47 is better at.