The equilibrium equations describe how the beam carries external pressure loads with its internal stresses. Rather than deal with these stresses themselves, we choose to work with the resultants since they are functions of x only (and not of y).
To enforce equilibrium, consider the balance of forces and moments acting on a small section of beam,
Equilbrium in the y-direction gives the equation for the shear resultant V,
Moment equilibrium about a point on the right side of the beam gives the equation for the moment resultant M,
Note that the pressure load p does not contribute to the moment equilibrium equation.