The proximity fuse
is a device used for detonating munition
s. It is designed to detonate when a target closes to within a specified range of it - or, conversely, when it closes to within a specified distance of a target. It (usually) doesn't make the distinction.
This is a wildly useful toy to have in your arsenal, since in many cases it can up your probability of kill immensely. Some targets, especially fragile ones, are just as sensitive to a near-miss as to a direct impact; some, in fact, are more sensitive to near misses from certain types of weapon. The ideal example is the aircraft; they are fragile enough and under enough stress while in flight that the amount of damage required to bring one down is fairly small. This means that an explosive munition, especially one equipped with shrapnel, need only detonate near its target.
The proximity fuse was invented during the Second World War, and was an outgrowth of the work then underway in a number of countries. Really, it's just a simplified radar; in the most basic form, it simply measures the strength of an electromagnetic field, and when the strength goes beyond a preset limit, it detonates. This works well by itself against metallic targets. Some varieties also put out an EM field, and measure changes in the ambient which indicate 'reflection' or interference with the field, detonating upon detection of such changes. Various types of sensors were tried - optical and acoustic, more notably - before the British brought the magnetron to the U.S. and electronic emissions (radio) could be reasonably utilized. This latter was the method used by the first successful variant.
When they were invented they were extremely secret and were used first for detonating anti-aircraft artillery (triple-a) shells near aircraft. As the Allies were anxious to preserve the secret of the proximity fuse, they were given the official misleading name 'VT fuse'. The 'VT' stood for 'variable time,' which was true after a fashion! Allied command dictated that they weren't to be used anywhere that dud rounds might be recovered by the Axis Powers, so initially they were only used in naval AAA. This prohibition was relaxed during the V-1 attacks on London and Antwerp to permit their use against these weapons. They performed very well in this role, dramatically increasing the effectiveness of AAA against the buzz-bombs; however, some were captured by the Wehrmacht during the Battle of the Bulge. This caused the Allies to frantically begin work on a countermeasure to the initial Allied VT fuse, which was accomplished using an existing radio jammer set to sweep the fuse sensor Doppler frequencies.
Proximity fuses can be used in all sorts of environments. From the anti-aircraft to air-to-air cannon later in the war; to undersea, with the American WWII Mk. 10 Magnetic Exploder torpedo. This latter weapon was designed to travel beneath target ships and, upon detecting change in the Earth's magnetic field caused by a ship's hull, detonate, breaking the back of the ship. Although there were troubles with this weapon, they were eventually traced to depth controls inside the torpedoes as well as the exploder itself.
They are still used today, where on the more expensive and fast-moving anti-aircraft missile (be it surface or air-launched) they serve to detonate the relatively small warhead near to enemy aircraft. It is much harder if not impossible to salvo guided missiles in the same numbers as shells were used during the Second World War; ergo, they are usually fitted with a reasonably smart fusing system. In many cases, these weapons contain much more sophisticated guidance and control systems - all of which have the mission of getting the weapon close enough to let a relatively simple proximity fuse do its job.
Thanks to DerekL for corrections both typographic and factual!