If you say that someone has got their just deserts, you mean that they deserved the unpleasant things that have 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