What is the science behind sports drinks?

Caffine, sugar, and salts gives you energy and keeps your heart beating rapidly and stops dehydration.