Swept wings are used on most modern aircraft to reduce the effective critical Mach number of the wings. This allows airplanes to fly faster than they normally would be able to with a given airfoil cross section by reducing the apparent velocity of the aircraft from the point of view of its wings.
Early (pre-WWII) aircraft had no need to employ this technique because, though no one knew what an optimum high-speed airfoil should look like, airplanes were too slow for it to matter. However, as airplanes got faster, they were more and more likely to experience supersonic flow over the wings (due to the results of the continuity equation), which affects the performance of the wings and the handling of the aircraft. During World War II, a group of German engineers came up with the idea of sweeping the outboard part of the wings toward the aft of the aircraft in order to prevent this in high performance airplanes. The first operational jet aircraft, the Messerschmitt Me-262, was also the first application of swept wings.1 After the war, as jets came into more common use and the Germans' theories became known, this technology became a staple of aircraft design, and is found in all forms of military aircraft and commercial jetliners.
This works because of the vector nature of velocity. Suppose that the wing is swept back from straight by some angle Ω, that the freestream velocity is V, and that the velocity normal to the wingspan is VΩ. Then,
Since Mach number is defined as M=V/a, this means that, given that the freestream Mach number is M, that of the swept wing is MΩ, and the wing is swept by an angle Ω:
The critical Mach number of the airfoil as a straight wing, Mcr, corresponds to a specific value of MΩ, because MΩ is pretending that the wing is straight. Likewise, the critical freestream Mach number for the swept wing, McrΩ, will correspond to a specific value of M. Thus,
In other words, a swept wing increases the critical Mach number of an aircraft, thus increasing its safe operating speed.
Delta wings have similar properties and are used on supersonic craft, such as fighters and the Concorde.
1"Swept Wings", author unknown. http://www.soton.ac.uk/~genesis/Level2/Tech/Sweepw.htm