There are two physical things which increase average speed: riding more miles/week and riding hills as hard as you can, which is a much higher level of effort than most people realize they are capable of. And then spending a few years doing these two things at every greater mileages and levels of effort. The downside is that yes, it hurts, but we do it to get the result. Besides, it's actually a lot of fun.
There are bicycles which will also increase your average speed. These are road bikes with dropped bars, sized and fit so the rider can get low on the bike and still pedal hard.
There are also a great number of details involving the above, but which are mostly irrelevant compared to those two simple things.
__________________
Results matter