Bokeh balls – or to use their more finessed name: specular out-of-focus highlights – are a by-product of high contrast (dark background, point light-source) and out-of focus.
Studying the characteristics of bokeh-balls does have its use beyond bokeh-o-phile photography. By looking at the bokeh-balls one can discern a bit about the characteristics of how a lens renders out-of focus areas, namely: optical vignetting, aperture shapes and over/undercorrection of out-of-focus rendering.
Optical vignetting (sometimes also referred to as mechanical vignetting) occurs to bokeh balls towards the edges of the frame. See more about the phenomenon here, but in short: they are caused by that a part of the bokeh ball is trapped by the lens’ non-glass parts. While most lenses have optical vignetting, leading to what is referred to as cat’s eye bokeh, there are differences between how early (in moving from the image centre) it occurs, how severe it is, and how well stopping down alleviates optical vignetting.
Aperture shapes are likewise an important characteristic, especially as the number of blades, their roundness, and other factors start making themselves known once the lens is being stopped down. Importantly, the shape of bokeh balls are not only important when bokeh balls are sought: the shape of the aperture that so strongly shows up in bokeh balls also affects all other rendering of out-of-focus areas.
Over- and undercorrection refers to bokeh balls’ almost unique ability to highlight the lens’ approach towards correcting for spherical aberration. This is caused by that – from the lens’ perspective bokeh balls are not an artefact but a reality. Hence also the bokeh ball is also subject to any optical flaw and aberration the lens produces, including – importantly – spherical aberration. Hence, the brightness distribution of bokeh balls will serve as a perfect indicator of how the lens corrects for spherical aberration. Importantly, whenever a lens shows undercorrected bokeh balls behind the focal plane, then objects in front of the focal plane would be overcorrected (and vice versa).