For all the different types of riding, there is a "sweet spot" that makes it not only most efficient (fastest WITH lesser effort), but the most enjoyable. Geometry affects that directly.
The first item affected is steering; a 'steeper' head angle makes for faster steering, which can put you on your face going down a steep hill. But for flat areas, pavement, etc., it can be a good thing. Seat angle is next, and that directly affects where YOU are in relation to the pedals; it can be harder to pedal if you're too far 'behind' the pedals themselves (and inefficient if you're too far forward). Like Little Red Riding Hood, somewhere in the middle is 'just right'.
Measurements are also part of geometry; too short of a top tube (from the seatpost to the stem) can make you feel cramped, and make it harder to handle the bike. Too long of a top tube can actually injure you, from being too stretched out. A shorter wheelbase handles and turns faster, a longer one is more stable in the rough stuff.
There's a fair amount to it, that's why 'fit experts' can charge what they do. But they are best left to competitive riders; the average rider just has to hit 'comfortable'.
Example: for me, the distance from my all-the-way-down pedal to the top of my saddle is very nearly a meter; my ideal top tube/stem combo is 3/4's of that. I like my handlebar less than 1 inch below saddle height, and the 'kneecap drop' just behind the pedal axle. A handlebar less than 26 inches wide makes me feel cramped. My favorite bike's headtube angle was about 68 degrees, not real steep (70+ is considered 'XC aggressive').
They're getting closer, but with 29er's, it's still coming together, not as established; I couldn't tell you what my 29er fit numbers would be. (Not worried about it, either, a 29er is not in my future....)