The defence is called reflex bleeding. Muscular pressure ruptures thin membranes at the tibio-femoral joints, releasing haemolymph laden with alkaloids such as coccinelline. The fluid is bitter and deters ants, birds and small mammals, and the beetle can reseal and survive the loss.
The colour pattern is aposematic, a warning signal rather than camouflage, and it works only because the chemistry behind it is real. Studies across coccinellid species have found that brighter and more contrasting individuals tend to carry higher alkaloid loads, so the signal is at least partly honest rather than pure bluff.
One persistent piece of folklore is worth correcting: the number of spots does not indicate a ladybird's age. Spot count is a species character, fixed at emergence, and the seven-spot carries seven throughout adult life. Some species do vary in spot number between individuals, but never with time.

