During World War 2, the German military used Enigma machines to encrypt the messages they exchanged with their own forces. Unknown to the German High Command, Alan Turing’s team at Bletchley Park in England had cracked their encryption codes using highly sophisticated mathematics and hardware especially developed to speed up the processing. Their work laid the foundations for the ideas that Turing would later propose for the creation of the first general-purpose computers.
This Enigma machine is one of the few that survived the war. It was used on U-Boat U-209 from 1941 until early 1943. Before U-209 was sunk in the North Atlantic on May 6th, 1943, this Enigma machine had been transferred to the submarine hunter U-Jäger 1712 where it was captured by Allied Forces.
The model shown here is a four-rotor Kriegsmarine M4 or Abwehr version.
The Wikipedia article here is a good introduction to how Enigmas work.