These wired sensors are typically used with alarm, access control and automation systems, for doors, windows, man doors, overhead doors, safes or gates. They are typically known as magnetic contacts, magnetic sensors or door switches.
Magnetic sensors use a sensitive reed switch that is triggered when the magnet is moved close or away from the reed.
Surface mount door window sensors are the most popular sensors as they are simply attached to the door or window. They are particularly popular for newer doors and windows where a recessed sensor may void a warranty.
Recessed sensors or flush mount sensors are harder to install as they must be drilled right in to the door or window and frame, but as a result they tend to disappear. They make for a much more attractive installation and it's less obvious that a sensor is in place.
Overhead door contacts are for garage doors and overhead rolling doors in home or commercial applications. They tend to be larger with a wider operating gap and often have armoured cable to protect the wiring.
High Security or Balanced Magnetic contacts are for higher security applications where there is concern the sensor may be tampered with. They are much more expensive and tend to be used in banks or for safes or vaults.