It's all about osmosis.
If your body is very dehydrated, you'll have a high salt content in your body. Your cells are in a hypertonic solution. The water moves out of your cells, causing the cells to shrink up and you can die.
If you're overhydrated, your cells have a higher salt content (hypotonic)than the solution that they're in which causes more water to pass into your cells. The cells eventually swell, explode, and you die.
When you sweat you lose salt and electrolytes. If you rehydrate with plain water you arent replacing the electrolytes and you can produce a hypotonic state. This is when sports drinks can help. But since sports drinks are mainly water, if you overhydrate with them you'll remain in a hypotonic state, which is bad.
What you want to is maintain and isotonic balance in your body.
See? Easy peasy.