In this case of takeoff, the fast air bearing down on the plane generates an upward force on the wings (analogous to a gun's recoil), which helps lift the aircraft. In short, pilots like to take off into a headwind because it helps them achieve wheels up faster.