Death Valley formed between two mountain ranges, the Panamints and the Amargosas, as the earth tilted, creating uplifts and the valley. A lake formed in Death Valley at one time, but when it evaporated, minerals including salt and borax remained.
In this photo, taken at Badwater, you can see the ridges where salt crystals have oozed up from the surface. I'll stop trying to explain geology and just say that Badwater, at 282 feet below sea level, is the lowest point in North America. The highest temperature recorded there was 134 degrees in 1913.