Very little is told about the history of the planet Tatooine, but many facts indicate that the planet was not always desert (canyons, Dune Seas, sandy plains, salt flats). Weren't there oceans and/or thickets?
Even an article on Wookieepedia gives some tips:
Once the seabed of one of Tatooine's vast oceans, the salt flat became a dry expanse of a hard-packed fusion of clay and sodium-rich sand blown in from the Western Dune Sea.[1]