For any fluid that is not compressible, (as air flowing at subsonic speed is) the total pressure must remain constant. This is the essence of Bernouli's principle, which is based on conservation of energy. So since the total pressure must remain constant, when air is flowing at some velocity (less than subsonic) relative to the measuring instrument, the pressure measured parallel to the flow (the dynamic, or ram, pressure) increases as the velocity increases, so the pressure measured perpendicular to or across the flow must decrease in order that the total remain the same. This pressure, measured perpendicular or across the flow, is referred to as the static pressure.
In an aircraft we measure these two pressures by simply orienting two measurement sensors appropriately, one (the pitot tube) parallel to the flow, and which displays on the airspeed indicator, and the other (a static port), with the opening perpendicular to the flow, which displays on the altimeter.
Because the airspeed indicator measures the dynamic pressure pressing on the pitot tube, even at zero airspeed there would be some pressure there, in order to make the displayed value measure airspeed, you must subtract the zero airspeed pressure, so the membrane inside the airspeed indicator has the dynamic (ram) air pressure on one side,, and the static pressure from the static port on the other side, and therefore moves only according to the difference between them, i.e., according to that amount of Ram air pressure which is greater than the static pressure, i.e, the pressure in the pitot tube due to motion through the air.