A boundary layer exists whenever a fluid (liquid or gas) flows over a surface. The boundary layer is the part of the gas that feels the skin of the baseball and is thus accelerated. The concept of the boundary layer was introduced by Ludwig Prandl in 1904. He is commonly called the father of aerodynamics.
In a wind tunnel, where the ball is still and the gas moves, the boundary layer contains the gas that goes from the wind speed down to zero at the ball. Before getting to the round surface of a ball, think about the floor of a wind tunnel as shown in the clip below.
The yellow dots are gas molecules. They are initially all moving at the same speed, but as they encounter the grey plate, the ones near the plate slow down due to the viscosity of the air, forming a boundary layer. In the case of a moving ball, the boundary layer is formed when the surface of ball speeds up the stagnant air molecules near its surface.
Boundary layers grow in thickness if the air velocity is constant and grow much faster if the air is slowing down (what we call an adverse gradient). Boundary layers shrink if the velocity is getting faster, which it is on the entire front half of the ball. So the boundary layers on the front are too thin to detect in our measurements.
Boundary layers can be laminar or turbulent. Adverse gradients tend to cause transition from laminar to turbulent, as do disturbances such as roughness or bumps (e.g. seams). Turbulent boundary layers are much thicker than laminar ones and grow faster too. For a really fantastic video of a turbulent boundary layer growing on a flat plate, see below.
The “Reynolds number” the movie mentions is the plate speed times length divided by viscosity and is a common way to express speed versus viscosity in fluid dynamics. Higher Reynolds numbers result in turbulent flow. But it’s not all about speed. For instance, you may be surprised to learn that the flow on the heat shield of the space shuttle upon re-entry was laminar due to low viscosity of air in the upper atmosphere.
The air in a boundary layer is rotating, which we quantify as vorticity. The boundary layer on top of the ball spinning clockwise (which we normally color blue) and counter clockwise below (which we color red). We care about this because at some point near the center of the ball, the boundary layer separates from the ball and forms a wake, and plotting vorticity makes it very easy to see the wake, as show below. This ball is moving left to right at 90mph and is spinning 1650 rpm.
We can see from this wake that the ball has lift (since the wake is tilted down), in this case due to Magnus effect.