Work to rule is one of the things a union can do to force companies to the negotiation table.
If there is a culture of the staff working unpaid overtime or skipping permitted breaks or similar then work to rule will mean that everyone behaves exactly as their contract specifies.
Usually slows down production.
Malicious compliance is usually effective if there is one particularly stupid boss who tells you to do something like "check all the keyboards and throw away any dirty ones".
Normally you'd say "did you mean clean them?"
If doing malicious compliance you'd go round, collect all the the keyboards (all keyboards are dirty) and chuck them in the compactor.
Now nobody can do any work and the business gets a bill for £20,000 to replace all the keyboards.
You get hauled into the office for it and then say "boss A told me to do it".