Frame size gets a bike roughly fitting a rider, but geometry — the angles and relative measurements of the frame — is what shapes how that bike actually feels and handles once you're riding it.
A more relaxed, upright geometry (common on hybrids and roadsters) puts less weight on the hands and more emphasis on visibility and comfort — well suited to commuting and casual riding, where sitting upright in traffic matters more than aerodynamics. A more stretched-out, lower-front geometry (common on performance or trail-oriented bikes) shifts weight forward for better control at speed or over rough terrain, at the cost of a more hunched riding position.
None of this shows up as a single number the way frame size does, which is part of why two bikes in the "same size" can still feel noticeably different to ride — geometry, not just size, is doing a lot of that work.