Foundations of the Navier-Stokes boundary conditions in fluid mechanics