Created in 1958 by Eugene Stoner, the AR-15 was a refinement of his previous design, the AR-10. The AR-10 was a select-fire rifle chambered in 7.62 NATO designed to replace the M1 Garand in service, but it lost in competitions to the M14. After some refinements were made, Stoner modified the design around the new 5.56x45mm NATO cartridge once the military realized a smaller, lighter cartridge and rifle was needed after the experiences soldiers had in Vietnam with the M14. This new design was designated the AR-15. It went on to be adopted by the military as the M16 series. The M16 then went through several updates of its own with more variants than would be practical to list. However, the primary variants to keep in mind would be those adopted by the infantry forces of the United States Army: the M16A1, 'A2, 'A3, and 'A4 (only the AirForce used the original M16). Later, in 1994, the M16 series received a new variant: a 14.5" barreled carbine designated the M4 Carbine. It later was accompanied and generally replaced by the M4A1, and both carbine variants can be seen in active service across all branches.
The M16 was originally marketed towards the military as a self-cleaning, no-maintenance rifle. Unfortunately, the conditions in which the tests were undertaken were far from being conditions one might find on a battlefield. The test rifles also used a very clean-burning powder, and truly could be considered somewhat low-to-no-maintenance as far as small firefights went. Once the M16s were issued overseas in Vietnam, however, the initial design's shortcomings became quickly apparent: the dirt and moisture of the jungle environment caused failures to feed and chamber. Due to the smooth bolt-carrier and slabsided receivers, when jams occurred, it took a huge amount of effort from the user to get it serviceable once more. What didn't help was the government's decision to switch to a cheaper gunpowder for the ammunition that burned much dirtier, leading to far more frequent jams in the rifles.
Most all of these issues were corrected with the M16A1, however. The 'A1 introduced, among other things, a forward assist on the receiver that enabled a soldier to force-chamber a slightly-out-of-battery round, a chrome-lined chamber to assist in feeding (also would not rust), and an improved, solid-tip flash hider that helped disperse flash better and also eliminate snag issues the previous "prong" hider occasionally had.
After Vietnam, the rifle was again updated with the M16A2 variant in early/mid-1980s. It removed the full-automatic fire mode from the weapon and replaced it with a three-round burst feature in order to cut down on ammunition wasted by the individual soldier. The M16A2 also introduced a slightly longer buttstock, a pistol grip with a finger shelf, and symmetrical, cylindrical handguards that were stronger and easier to replace since left- and right-side handguards were identical, unlike the M16A1's requirement of keeping both left-side and right-side handguards on their respective sides. The M16A2 also refined the rear sight of the 'A1, leading to finer adjustments during zeroing for slightly improved accuracy in the field.
The M16A3 was a mixture of both the M16A1 and M16A2. It featured the upper of the M16A2 (improved flash hider, more adjustable iron sights, "clamshell" handguards, etc.), and it also featured the lower receiver of the M16A2 (reinforced area by take-down pins, longer buttstock, different grip), but it had one big difference from the M16A2 that it was otherwise identical to in appearance: it had the full-auto mode the original M16A1 featured instead of the three-round burst. Interestingly enough, the M16A3 has only been used by specialized units, one such example being the US Navy's SeaBees. The only way to differentiate an M16A3 from an 'A2 is to read the rollmark on the side of the receiver. Contrary to popular belief, the M16A3 did not feature a flat-top receiver. The confusion here lies with Colt giving the US Army a prototype to test that did have a flat-top receiver (M16A2E4). Colt assumed this rifle would be adopted quite soon, so they began marketing their commercial flat-top rifles on the civilian market as AR-15A3s. The Navy adopted the M16A3 before the M16A2E4 completed its testing, however, so the true M16A3 is simply an M16A2 that fires fully-automatic instead of in bursts. The M16A2E4 was then adopted as the M16A4 by the military. Colt calling its flat-top rifles 'A3s has lead to the common confusion, however, that M16A3s all had flat-top receivers with integrated Picatinny rails, which is incorrect.
The flat-top receiver with the Picatinny rail was adopted as the M16A4, though, as mentioned. At first, that was the only difference between it and an M16A2 as it retained the safe, semi-, burst-fire selector modes of the M16A2 rifle and used the same handguards. Later on, though, a quad-rail handguard was adopted (Knights Armament Company M5), and the rifles were typically equipped with an ACOG or a red dot sight of some kind. The M16A4 with this quad rail attached was given the name of "M16A4 MWS (Modern Weapon System)" on paper, but is in no way different from the standard M16A4. Since swapping furniture is no big deal, plenty of people still refer to either rifle as, simply, the M16A4.
In 1994, the M4 Carbine was introduced. It was more or less a shortened M16A2 (14.5in. (36.8cm) barrel) with a collapsing stock, to put it simply. The very first M4 Carbines used shortened, cylindrical handguards, had a fixed carry handle, and retained the three-round burst feature. Only the first batch of M4s had the integral carry handle sights, however, and all other batches had flat-top, railed receivers, more or less turning it into a shortened M16A4 with a collapsing stock. The M4 Carbine was further modified later on, however, and was given a quad-rail for attaching lights, lasers, foregrips, etc. This was known as the SOPMOD variant of the M4 Carbine (Special Operations Peculiar MODification). Future M4s were pretty much all modified to this configuration, however, along with the M16A4 as the United States modernized its infantry more during the War on Terror. The M4 Carbine underwent slight modification later on again and the M4A1 was introduced. The primary difference - and practically the only difference - between them is that the M4A1 Carbine was capable of fully-automatic fire.
The M16 was originally marketed towards the military as a self-cleaning, no-maintenance rifle. Unfortunately, the conditions in which the tests were undertaken were far from being conditions one might find on a battlefield. The test rifles also used a very clean-burning powder, and truly could be considered somewhat low-to-no-maintenance as far as small firefights went. Once the M16s were issued overseas in Vietnam, however, the initial design's shortcomings became quickly apparent: the dirt and moisture of the jungle environment caused failures to feed and chamber. Due to the smooth bolt-carrier and slabsided receivers, when jams occurred, it took a huge amount of effort from the user to get it serviceable once more. What didn't help was the government's decision to switch to a cheaper gunpowder for the ammunition that burned much dirtier, leading to far more frequent jams in the rifles.
Most all of these issues were corrected with the M16A1, however. The 'A1 introduced, among other things, a forward assist on the receiver that enabled a soldier to force-chamber a slightly-out-of-battery round, a chrome-lined chamber to assist in feeding (also would not rust), and an improved, solid-tip flash hider that helped disperse flash better and also eliminate snag issues the previous "prong" hider occasionally had.
After Vietnam, the rifle was again updated with the M16A2 variant in early/mid-1980s. It removed the full-automatic fire mode from the weapon and replaced it with a three-round burst feature in order to cut down on ammunition wasted by the individual soldier. The M16A2 also introduced a slightly longer buttstock, a pistol grip with a finger shelf, and symmetrical, cylindrical handguards that were stronger and easier to replace since left- and right-side handguards were identical, unlike the M16A1's requirement of keeping both left-side and right-side handguards on their respective sides. The M16A2 also refined the rear sight of the 'A1, leading to finer adjustments during zeroing for slightly improved accuracy in the field.
The M16A3 was a mixture of both the M16A1 and M16A2. It featured the upper of the M16A2 (improved flash hider, more adjustable iron sights, "clamshell" handguards, etc.), and it also featured the lower receiver of the M16A2 (reinforced area by take-down pins, longer buttstock, different grip), but it had one big difference from the M16A2 that it was otherwise identical to in appearance: it had the full-auto mode the original M16A1 featured instead of the three-round burst. Interestingly enough, the M16A3 has only been used by specialized units, one such example being the US Navy's SeaBees. The only way to differentiate an M16A3 from an 'A2 is to read the rollmark on the side of the receiver. Contrary to popular belief, the M16A3 did not feature a flat-top receiver. The confusion here lies with Colt giving the US Army a prototype to test that did have a flat-top receiver (M16A2E4). Colt assumed this rifle would be adopted quite soon, so they began marketing their commercial flat-top rifles on the civilian market as AR-15A3s. The Navy adopted the M16A3 before the M16A2E4 completed its testing, however, so the true M16A3 is simply an M16A2 that fires fully-automatic instead of in bursts. The M16A2E4 was then adopted as the M16A4 by the military. Colt calling its flat-top rifles 'A3s has lead to the common confusion, however, that M16A3s all had flat-top receivers with integrated Picatinny rails, which is incorrect.
The flat-top receiver with the Picatinny rail was adopted as the M16A4, though, as mentioned. At first, that was the only difference between it and an M16A2 as it retained the safe, semi-, burst-fire selector modes of the M16A2 rifle and used the same handguards. Later on, though, a quad-rail handguard was adopted (Knights Armament Company M5), and the rifles were typically equipped with an ACOG or a red dot sight of some kind. The M16A4 with this quad rail attached was given the name of "M16A4 MWS (Modern Weapon System)" on paper, but is in no way different from the standard M16A4. Since swapping furniture is no big deal, plenty of people still refer to either rifle as, simply, the M16A4.
In 1994, the M4 Carbine was introduced. It was more or less a shortened M16A2 (14.5in. (36.8cm) barrel) with a collapsing stock, to put it simply. The very first M4 Carbines used shortened, cylindrical handguards, had a fixed carry handle, and retained the three-round burst feature. Only the first batch of M4s had the integral carry handle sights, however, and all other batches had flat-top, railed receivers, more or less turning it into a shortened M16A4 with a collapsing stock. The M4 Carbine was further modified later on, however, and was given a quad-rail for attaching lights, lasers, foregrips, etc. This was known as the SOPMOD variant of the M4 Carbine (Special Operations Peculiar MODification). Future M4s were pretty much all modified to this configuration, however, along with the M16A4 as the United States modernized its infantry more during the War on Terror. The M4 Carbine underwent slight modification later on again and the M4A1 was introduced. The primary difference - and practically the only difference - between them is that the M4A1 Carbine was capable of fully-automatic fire.