Fuelling is not an exact science because at the end of the day, we are all different and when it comes to running there are extra variables. The variables to consider of course, are whether it's a road or a trail run, the weather, temperatures etc.
At very small local 5k or 10k road races, you normally tend to find plenty of aid stations with at least water and a lot of times other types of drink, potentially fruit, snacks or gels. Therefore, for a short road race, planning for fuelling and hydration is not normally an issue in comparison to a longer road race or a short to long trail race.
I mentioned shorter trail races as these tend to have less aid stations due to a number of factors, technicality of the trail and getting aid stations into place, the size of the running field (i.e. how many runners as trails races tend to have smaller fields than road races), number of volunteers, sponsors and resources.
As a side point bigger road races tend to have more sponsorship as they tend to attract bigger fields of runners and tend to get more media than at a trail race. Also trail races can be limited by permits from the city or park board in charge of the area the trail runs through.
Back to fuelling and in a nutshell this is similar to putting gas/petrol in your car. What you put in affects what comes out and how the car/body reacts. So it's important to try and get on top of your fuelling before race day to try and get your optimum performance.
If you aren't a runner or are new to running then you may not have come across gels. Basically a lot of sports nutrition brands have managed to shoe horn protein, carbs etc into a gel/sticky goo which comes in sachets that are easy to consume on the go. The only thing with gels is it's not real food and too much gel consumption can give some people gut issues. Also as it can be sweet and not real food, they can lead to nausea. Some runners tend to find gels are not an infinite resource as you can get tired of the taste and consistency etc.
Everyone is different of course but I'd suggest trying to plan your use of gels and having other nutrition in between to break up the use to prevent getting tired of them or even having gut issues from using them.
Another way to fuel on a long run or a race is using energy bars, protein bars and granola bars. This is closer to real food than gels but the issues you can have here is, as you get tired towards the end of your run or race and the bar is too chewy you could have issues getting that bar in you.
When running ultra races the aid stations tend to have slightly different options such as coke, cookies, potato chips etc. It's not exactly always a healthy spread but the chips help replace salts, the sugar in the coke helps with low energy and low sugar levels in the body, cookies are easy to eat and are good with sugar. There might be electrolyte drinks and possibly fruit. At some races there are options like soup, quesadillas, grilled cheese and peanut butter and jelly sandwiches.
In respect to hydration, some runners stick just to water and some people add some electrolytes to the mix. Some people will have a bottle or hydration pack with water and then one with just water. Again it's personal preference and what works for you. The key is to have the right balance, as dehydration and hyponatremia, too much electrolytes replenishment or too little can also create issues.
The other thing to remember is that balance of hydration and fuelling is mostly done whilst running or power hiking if you hit a really big climb! Most races have aid stations but you can not rely on this especially if they are spread out and it's a hot day for example. Also if certain things affect your gut you may be best carrying your own nutrition.
How do I know about fuelling and nutrition? Because I have spent a lot of hours on my feet running and trying to perfect the right balance. Even sometimes when you think you have the right balance it goes south and a prime example was a 45km long run I did the past Sunday. I spent 15k of the route feeling like I could throw up and it's not a feeling I'd like to repeat.
The key thing to remember is practice your fuelling and your hydration on your training runs, on your long runs and try not to ever try anything new on race day.