The term "BB" originated from the size of steel balls used in a shotgun shell of the same size. BB shot was normally 0.180 inches (4.6 mm), but tended to vary considerably in size due to the high allowable tolerances for shotgun shell use.
Around 1900, Daisy, one of the earliest makers of BB guns, changed their BB gun bore diameter to 0.175 inches (4.4 mm), and began to market precision-made lead shot specifically for their BB guns. They called these simply "round shots", but the "BB" name was already well established, and everyone continued calling the guns "BB guns" and the shot "BB shot" or just "BBs".
Subsequently, the term "BB" became generic, referring to round shot of various calibers and materials. This included (and still includes) bearing balls, plastic round shot (such as used in airsoft), 0.177 caliber lead and steel shot, marbles and many others. It should also be noted that the ubiquitous usage of the term bearing for any steel ball is technically incorrect. A ball bearing is a mechanical bearing constructed with the intent of it being used to reduce friction or bear weight.