The brits had an idea how enigma worked due to earlier work by the Poles, but the WWII version wasn’t broken until a code book was confiscated from a captured U-boat.
The Naval enigma machine had more complexity to it than did the Army enigma machine on which the Poles worked at the start of WWII. The Germans also developed a different code for super-secret transmissions. However, the capabilities of Bletchley were better suited to cracking that problem - and the Brits were decoding those messages faster than the simpler ones.