I find real food hits the spot better than just sugary ****.
It's also very important to look at what intensity you're riding at, what kind of terrain, and ultimately what your nutritional needs are (based on the riding as much as your metabolic adaptation) .
If you're riding lots of hills, high intensity and keeping your heart rate high, prioritize more glucose (sugar/carbs)
If you're riding in high heat / humidity, and sweating lots, then you'll want to try and replenish your electrolyte / salt levels. Sodium/potassium/magnesium are the main 3. Salty / savoury foods on the bike can help with this. Beef jerky, cheese, salami, olives ...
If you're riding long/slow/steady distances, and your metabolism is good at burning fats, you might need nothing or just the odd bit of almond butter or nuts here and there.
I fuel very differently depending on the distance and type of ride.