Not forgetting of course that it was the Enigma machine, not the operators, that created the code. The operator would type in the plain text, while a colleague would dutifully note the letter lamps that would light up as each letter key was pressed. The coded message would then be sent to the recipient who would set his machine to the same settings, and type in the gibberish to be rewarded with the plain German text.
The Enigma machine had been invented in 1919, initially for banking security - what the German forces did was to make it vastly more complicated by greatly increasing the number of possible wheel settings and add a plugboard to transpose pairs of letters further, adding billions more permutations. Turing's greatest achievement of all was to devise a machine - the 'bombe' - that replicated the workings of several pairs of Enigmas to find potential matches between cipher and plain text. After some modification, this proved immensely successful in the early part of the war - only when the U-boats started using an Enigma with four wheels instead of three did it run into trouble.
This is all, of course, a ridiculously simplified overview of how it all worked. :-)