SFAIK, it all started as M = Model. But it's not something that has been consistent over time.
"Rifle, Springfield, Model of 1903" or "Pistol, Colt, Model of 1911".
Then it was simplified with the Garand and the Carbine, as just M-1 for each. Dangfino.
I got to play with the M-16 half-track, back in 1955. Then with the dash dropped out, here came the M16 rifle.
I don't worry about it.
I always figured, "There's the right way, the wrong way and the Army way." It ain't right, it ain't wrong, it's just the way the Army does stuff. Shrug...