If you say
that someone got their just deserts
, you mean that they deserved
the unpleasant things that happened
to them, because they did something bad
At the end of the book the child's true identity is discovered, and the bad guys get
their just deserts.
COBUILD Advanced English Dictionary. Copyright © HarperCollins Publishers