Here are the (hopefully simple) answer to questions...
Q why salt and sugar? what role do they play?
A Whenever there is dehydration, there is a loss of fluids and electrolytes in the stool (generally referring to diarrhea). So water and salt is what needs to be replenished.
Using water alone is not effective for two reasons, one the intestines are not absorbing water in diarrhea (in fact they are secreting it leading to water loss). Two, the electrolyte (salt) loss is not taken care of by just giving plain water.
SO the salt & water given is just a replacement. The glucose has a different & very interesting role, it helps in absorbing the salt & fluids from the intestines (through a pretty complicated mechanism that cannot be explained easily to a 5 year old :)
what about electrolytes?
The word salt and electrolyte is used interchangeably here, the oral rehydration solution contains a mixture of salts most importantly sodium and potassium, which are generally the same ones lost in the urine, so these are replaced
why is the mixture important?
Well it is the easiest and the most effective way of preventing dehydration and death (in developing countries) in diarrhea cases
Can you become more dehydrated if the mixture of these elements is wrong?
Absolutely, a high glucose concentration can lead to diarrhea, while a high salt concentration can lead to abnormal electrolytes in the body leading to severe problems like seizures etc.
You can read more here