Here’s a basic history of the standard infantry weapon in the US and the thought that went into it.
Once the US revolutionary war started, for some silly reason the British weren’t willing to give us British muskets any more (gosh, wonder why…). The French however were all too happy to sell us their older muskets. The first weapons made in the US were basically copies of the French Charleville muskets (that shouldn’t actually be called Charlevilles, but that’s a topic for another thread).
In the war of 1812, they found that they couldn’t produce muskets anywhere near fast enough, so a lot of improvements were made that were focused on producability. This trend continued to the mid 1830s. In the 1840s, they switched from smooth bore flintlocks to percussion cap rifle-muskets. In 1855 they tried to replace the caplock with a paper tape cap system kinda like what you have in old toy cap guns, but that didn’t work very well and in 1861 they went back to the old style percussion caps. Percussion cap rifle-muskets were the main weapon of the US Civil War.
As an aside, the Civil War era rifle-musket and its accompanying Minie ball were the worst standard infantry weapon to be shot with in all of history. Those big slugs of lead made huge holes and easily shattered bone.
Anyway, the increased rate of fire from cartridge rifles definitely made an impression on folks during the Civil War, so after that, they converted a lot of the rifle-muskets to cartridge rifles. Google Trapdoor Springfield Rifle if you want more info on those). The Trapdoor Springfields remained the standard infantry rifle up through the 1890s.
The next improvement was to use magazines instead of loading each round one at a time. This was adopted in the Krag-Jorgensen rifle.
In the Spanish-American war, American soldiers got their butts kicked by the German 1893 Mauser rifle. That (along with a lot of politics) led to the design of the Model 1903 Springfield rifle.
The next improvement was to make the weapon semi-automatic, and that became the M1 Garand. That was used extensively in WWII.
The next big improvement was to make the weapon capable of select fire, so that it could fire in semi-automatic mode like the M1 Garand, but could also fire in full auto mode if desired. That became the M-14.
Up until this point, all standard infantry weapons fired a full power round. In the musket era, your typical military musket was somewhere around .50 to .75 cal. (with some higher), where a typical hunting rifle was more like .40 to .50 cal. By the early 1900s, military forces all around the world eventually settled on something around .30 cal. (7.62 mm is .30 inches). The M-14 was the last standard infantry weapon to fire this type of round, at least in the US.
Up until this point, most armies tended to go in the same general direction, design-wise. They all went from flintlocks to caplocks to cartridge rifles to semi-auto to selective fire. But this is where the two largest armies (the US and the USSR) diverged significantly.
The M-16, as already mentioned, was designed to reduce the weight of both the weapon and the ammo.
The Soviets, in contrast, kept the larger 7.62 mm round, giving the AK -47 more of a punch than the M-16. The AK-47 is also cheaper and easier to produce, but its accuracy suffers a bit as a result. The AK-47 is designed to be used within a few hundred yards, for the reasons that MichaelEmouse posted. That’s where most of your infantry battles take place.
The M-16 is better at longer ranges. Hitting a man at 300-400 yards with an AK-47 is going to be mostly a matter of luck, or firing enough lead that something eventually hits. At shorter ranges, the AK-47 is better at punching through thick brush (like the jungles of Vietnam) and can punch through some building walls that will stop an M-16’s lighter round. The tighter tolerances of the M-16 help it to be more accurate, but it’s also easier to foul it up with dirt and stop it from working. The AK-47’s looser fitting parts can take a lot more abuse before anything jams, but they are also one of the main causes of the weapon’s decreased accuracy (and it’s cheaper and easier producability). Guys shooting AKs require more shots (since the weapon isn’t as accurate) and for the same amount of weight, they can’t carry anywhere near as much ammo. Supplying the AK soldiers with ammo also requires more logistics effort all the way up and down the supply chain. Each weapon has its good points and bad points.
The fact that each weapon is very successful proves that either design philosophy works. While they both have their pluses and minuses, neither design has proven itself superior to the point where the other side has chosen to change their design philosophy.
Lately there’s been more of an emphasis on urban combat, and we’re starting to see a lot more bullpup designs as a result. They haven’t replaced the M-16 yet though.