Here is Canvas object wihch demonstrate the problem.

Fa , Fb = resultant forces of bending stresses acting on the bottom 2 x 12 board


To satisfy equilibrium, additional horizontal forces must be provided to the 2 x 12 board.

This is where the nails enter the picture.

The shear force provided by the nails is needed in order for the 2 x 12 board to satisfy equilibrium in the horizontal (i.e., axial) direction.