What does ‘Spanner in the works’ mean?

An event that disrupts the natural, pre-planned order of events could be described as a “spanner in the works.”

The phrase describes the mayhem caused when something is recklessly thrown into the intricate gears and workings of a machine.

“By getting pregnant, Mary threw a spanner in the works.”