The M16 came about after WWII when the US was looking for something to replace the M1 and Thompson. During the Korean war US gun makers decided that the military needed a small caliber, high velocity round; they also recommended a move to fully automatic ARs instead of the semiautomatic rifles.

 

The request ultimately resulted in a scaled down version of the AR-15 and the M16 become the primary weapon of the US army in the mid 1960s and is now used in almost   every country in the world.