Hydration is important, but often overlooked. Lack of water is more likely to cause a quick death than any other single nutrient. Our bodies need water.
Most people rely on thirst to signal the need for water. Unfortunately, thirst is a lagging indicator; it doesn't kick in until you're already a liter or two low.
Water carries nutrients to our cells and carries away waste. It helps us maintain a healthy body temperature. Our muscles and organs are about 70% water.
Staying hydrated during exercise will help us have a less pronounced increase in our heart rate while we exercise, and help us maintain our core body temp., avoiding overheating. It also reduces the glycogen usage of our muscles as they work - the energy needed to power them.
All of that means that water will improve our endurance.
So drink, my friends - before, during, and after.