Waydaminit, AC. You just typed 'deserts' twice. Wasamatterwifyouman? Well, yes and no. The two usages are spelled the same way, but they are pronounced differently.
First, I typed 'desert' as in an habitually dry place like the Sahara or Death Valley for example.
Then, I typed 'desserts' as in ice cream and apple pie.
I won't go over the pronunciations because you all know that, but, in passing, I will offer up my wife's tip about remembering how to spell 'dessert.' You see, dessert is so good that you want two helpings. Therefore you type 's' (or 'ess') twice.
But I digress.
In the third instance, 'desert' is spelled like the arid region but pronounced like the after-dinner treat. Yes indeedy. You probably knew that because you're smart, but I didn't because I'm ... well ... uh ... you know ...
The only place that we employ the third usage, or at least how I employ it, is in the phrase, 'just deserts.'
Now, I have always thought that it was desserts with the two esses in the 'just desserts' phrase, but that is not the case. It is not that you are getting a rotten dessert for doing something naughty. Nope: you are getting what you 'deserve.' 'Desert' in this sense is an otherwise obsolete word, but we have kept the phrase, and that is what it really means.
You pronounce it like 'dessert' but you get what you 'deserve.'
Apparently, an old codger can learn new things, even if not every day. The trick is to remember. I think I will now.