“‘He has got his deserts’, said Joconda.” Jaconda said that in an 1882 novel by someone with the pen name “Ouida.” Both the novel and the writer (whose real name was Maria Louise Ramé) are not much remembered now, but the phrase “got his deserts” or “got his just deserts” is still around.
The phrase is a confusing one, because it’s pronounced as if it was “got his just desserts,” so it could possibly be an assortment of cookies and cakes. But it’s spelled as if it’s talking about deserts like the Sahara or Gobi, and it’s used as if it’s got nothing at all to do with either sweet treats or sandy wastelands. It’s so confusing that it’s sometimes written “got his just desserts,” which only serves to muddle things up even more.
In fact the “deserts” in “got his just deserts” really doesn’t have anything to do with sweets or sand because it’s a different word. The desert that’s sandy comes from the Latin word desertus, meaning abandoned. The dessert that’s after the main meal comes from the French word desservir, meaning to clear the table. That comes from the tradition in wealthy European households to serve the final course of a meal in a different room, which gave the servants a chance to clean up the main dining room. This dates back at least to the 1600s, and generally died out by the late 1800s. It may still be followed in some mansions, of course, and it’s still possible to find a restaurant here and there in which you’re ushered into a different room for the dessert course. (In the case of the restaurants, of course, their motivation may be to remove you from your seats so they can serve another set of paying customers.)
The “desert” that is what you get when you get what’s coming to you comes from another old French word, “deservir” — and notice that the confusion is probably not the fault of English; we’re talking about two French words that are almost identical: “deservir” and “desservir.” The two “deserts” (that is, DESert and deSERT) entered English at about the same time, during the 1200s. Since they’re pronounced differently, the confusion probably didn’t arise until literacy spread more completely and people had to start worrying about spelling.
And for swiping more confusingly-spelled words from French, maybe getting One More Thing To Worry About is simply us English speakers getting our just deserts.