Pilots must keep track of a lot of data when they're in the cockpit of an airplane. Airspeed -- the velocity of an aircraft relative to the air mass through which it's flying -- is one of the most important things they monitor. For a specific flight configuration, be it landing or economy cruising, a plane's speed must remain within a fairly narrow range of values. If it flies too slowly, it can suffer an aerodynamic stall, when there is insufficient lift to overcome the downward force of gravity. If it flies too rapidly, it can suffer structural damage, such as the loss of flaps.
On commercial airliners, pitot tubes bear the burden of measuring airspeed. The devices get their name from Henri Pitot, a Frenchman who needed a tool to measure the speed of water flowing in rivers and canals. His solution was a slender tube with two holes -- one in front and one on the side. Pitot oriented his device so that the front hole faced upstream, allowing water to flow through the tube. By measuring pressure differential at the front and side holes, he could calculate the speed of the moving water.
Airplane engineers realized they could accomplish the same thing by mounting pitot tubes on the edge of the wings or jutting up from the fuselage. In that position, the moving airstream flows through the tubes and allows for an accurate measurement of the aircraft's speed.