I asked my grandfather that once, he told me that was the way he had always bought ammo, rifle 20 rounds, pistol 50 rounds. His memory predated the M16 by many decades.
I would guess it was a nice round number in a day where there were very few guns that could hold more than five or six rounds. Since the time cartridge ammunition was first introduced there has really been no set standard as to how many rounds a gun will hold, so twenty seems like a economical number.
For deer hunting I typically buy a single box of ammo for the season. I will use three to six to verify and adjust sights and scope, and at the end of the season usually have several rounds left over. It doesn't seem like a big deal when you are talking ten cent AK ammo, but when I am buying for my .300Win Mag I really don't want to have to buy more than twenty rounds at a time, it would be very expensive.