FWIW, the Dead and Caspian seas are actually dismembered bits of ocean. They're salty because their water was originally salty. The only salty lake I can think of that didn't begin with ocean water is the Great Salt Lake, which is an evaporated basin from a much larger lake that just happened to sit on salty bedrock.
https://en.wikipedia.org/wiki/Salt_lake lists a number of salt lakes.
One is https://en.wikipedia.org/wiki/Mono_Lake , which did not begin with ocean water.
Another one is https://en.wikipedia.org/wiki/Don_Juan_Pond , which is a shallow Antarctic hypersaline lake that almost never freezes.
https://en.wikipedia.org/wiki/Little_Manitou_Lake_(Saskatche... is a terminal lake which formed after the Ice Age.
I'll also add a non-endorheic salt lake, https://en.wikipedia.org/wiki/Great_Salt_Plains_State_Park , made salty from the dried salts from an ancient inland sea. (I think it's the Western Interior Seaway, but I could be wrong.) In any case, it began with ocean water, which dried up, and that salt is dissolving again.
But many lakes do not have an outlet that leads to the sea. Water flows in and evaporates. Where does the salt go in that case?
It sticks around. The terminal lakes which aren't salty are generally ones which only formed recently (e.g., after the most recent glaciation) or ones which are not fed by rivers (e.g., Oregon's Crater Lake).