'BB' is a colloquialism and a trade term for airgun ammunition. The term originates with the original commercial airgun, originally manufactured by the Daisy Manufacturing Company in 1888. At the time, the airguns sold by Daisy were designed to use commonly-available individual shotgun shot for ammunition. They were built to accept a common shot size designated 'BB' which indicated a 0.180 inch diameter.
The biggest problem with using shotgun pellets as ammunition was that shotgun pellets were not very precisely manufactured, since their size was irrelevant to the construction of shotguns or shot shells. As a result, airguns often suffered from diminished velocity from undersized shot or even jamming from oversized pellets. Early in the 1900s, Daisy Manufacturing changed the design of its airguns to accept 0.175-inch shot and began to manufacture its own, more precisely-made lead ammunition for the guns. Since shotgun ammo no longer worked, customers were forced to buy Daisy's (admittedly much better performing) ammo.
This state of affairs continued up until the late 1920s, when a ball bearing company, noticing children making off with their discards, realized there was a market and began manufacturing steel airgun ammunition (still called BBs). The steel ammo, however, wasn't considered a precision item, so once more the problem of inconsistent shot size arose. This time there were more severe consequences, because although lead pellets were soft enough to 'squeeze through' restrictions if they were slightly too large, steel shot was definitely not. Airguns which used oversized steel shot would sometimes rupture behind the obstruction, or become permanently jammed. Daisy responded by forming a joint venture with the American Ball Company (the bearing manufacturers) by which Daisy agreed to market and distribute the steel ammunition if it was manufactured to proper tolerances.
Daisy's airguns were modified to accept steel shot (different retention mechanisms in the breech, different tolerances, etc.) and the modern BB gun, .177 caliber, came into being. Although non-spherical airgun ammunition is properly referred to as 'pellet ammunition', colloquial use in the United States still refers to most metal airgun ammo as a 'BB'. Airsoft guns are sometimes said to fire 'plastic BBs'. The only widely-used airguns not to fire 'BB' ammunition are paintball guns which fire soft .68 caliber spheres. Modern spherical BBs are typically mild steel coated with copper, zinc or other metals to prevent corrosion.