That which is deserved. A reward for what has been done - good or bad.
Deserts, in the sense of 'things deserved' has been used in English since at least the 13th century. A citation in which it is linked with 'just' comes from 1599, in Warning Faire Women:
"Upon a pillory - that al the world may see, A just desert for such impiety."
With this phrase it isn't the origin that is interesting though, but the spelling. I am often contacted by people pointing out that 'just deserts' is misspelled. They go to great lengths to explain why it should be 'just desserts'. They are wrong, but perhaps understandably so.
- Deserts is now almost always used in reference to desolate and arid regions of land. Its use to mean 'that which is deserved' is now largely limited to this single phrase.
- Desserts - the last or sweet course of a meal - is widely used and is pronounced the same way as the deserts in 'just deserts'.
So, when hearing the phrase with the pronunciation like 'desserts', people think it must be spelled that way too. The spelling might be more intuitive if we thought of the phrase as 'what you justly deserve'.
Most of the correspondence pointing out the 'error' comes from Australia. That may be coincidence, although it could be that, living in a hot, English-speaking country, Australians have more exposure to hearing the word deserts with the stress on 'des' than the rest of us.