Like sodium and chlorides, potassium is an electrolyte. That is, a mineral compound which dissolves into electrically charged particles, called ions, that conduct electricity when dissolved in fluids.
Electrolytes are important in an electrochemical machine, such as a human. They are essential for nerve and muscle function, and maintain both the body's fluid balance and acid-alkali levels in cells and tissues.
A healthy body requires a balance of just the right amount of fluid inside the cell, as well as outside it. Potassium helps to maintain this balance.
The average American eats a lot of salt, more than most sweaty endurance riders need. Combining a high table salt intake with a diet low in potassium is an especially bad idea which leads to high blood pressure, especially considering that lots of potassium, even on its own, reduces the risk of high blood pressure. Those with hypertension or high blood pressure can sometimes reduce their medicine intake by increasing their potassium intake.
The sweaty endurance rider does not really need to buy sports drinks supplemented with electrolytes. While it is true that electrolyte levels in the blood go drop when one exercises, current research indicates that it isn't lost in sweat, but rather migrates into body tissues. While it's harder to measure easily, it's still there.
It's true that riders new to hot weather tend to sweat away more salt than those better acclimatised. Unless your un-American diet is especially low in table salt, you'll probably have all the electrolytes you can handle. In fact, after a day of riding, we've sweated away more water than the salt in our body's fluids, so the salt concentrations in your body is higher!
This isn't to say that potassium is a bad thing, to be sure. Fruits and vegetables provide lots, especially dried fruits like dried apricots and peaches. By weight, sun-dried tomatoes have more potassium than any other food, at 971 mg per ounce, but note that an ounce is about half a cup.
Bananas, the staple riding food of cyclists everywhere, is an excellent source of potassium. Figs, raisins, and dates are also good. Prunes have too much fiber for the meal before a ride or a 6000 calorie per day diet, and avocado sadly has loads of fat.
Sweet potatoes, due to their low glycemic index, make a great food a few hours before a long ride, and are high in potassium. So are beet greens, ordinary potatoes (with the skin), kiwi fruit, celery, carrots, radishes, tomatoes, cantaloupe, honeydew melon, swiss chard, squash, and, of course, spinach.
Beans, seeds and nuts, great sources of protein (which, unlike animal protein, doesn't give you cancer), are also high in potassium. Look for white beans, soy beans (and soy in general), great northern black and kidney beans. With seeds and nuts, a little goes a long way, be it pumpkin or sunflower seeds, walnuts, pecans, or peanuts. Watch the fat intake, though.