This is a spanner.
The works is another term for a machine.
What would happen if you put a spanner in the works?
It would break and stop. That's exactly what workers used to do when they needed a rest from the demanding machines that they worked with.
Becoming a slave to machinery was already a worry in the time of Charlie Chaplin.
Here's an extract from the film Modern Times.