Take the Cake (N. Amer.)/Take the Biscuit (UK)

What does the idiom “take the cake (biscuit) mean”?

Definition: Even worse or more outrageous than previous examples.

Example: John has made mistakes at work before, but his latest screw-up takes the cake.