They're in everything, for the most part they are mineral salts existing happily in darn near all the foods you find.
Some foods have more than others; like bananas which are famous for the potasssium. And there's dear ol' sodium chloride which abounds in celery (and which I flagrantly add to my food!). Calcium salts in milk, etc.
Sweat runs off with a lot of your electrolytes (as does diarrhea, but we won't talk about that) so ya gotta watch out you don't end up with an imbalance during huge activity.
I always have Clif shot electrolyte mix in my water bottles, and I know it helps keep me happy on the bike. I eat Clif Shot blox, too, which also have electrolytes. Dunno if its the salts or the sugars that keep me happy, but it works so I ain't messin' with it!
"If Americans want to live the American Dream, they should go to Denmark." - Richard Wilkinson