Distance between handlebar and pedals requires biomechanical calculation of angle between chest and thigh, resulting in maximum force and respiration without oxygen deficit. Knee cap shall never project over axle of pedal when crank is heading horizontally. Above mentioned body tension has to be restricted when proceeding would mean deficit of oxygen. As chest may not necessarily be inclined that much like for road racing, frame geometry swivels by 2 degree to less sloping tubes, although it certainly provides slightly diminishing aerodynamics. Its determination is the first basic decision of creating a new frame geometry, highly affecting steerability, stress load and shock absorption.
Small frames require free pedaling clearance while big ones suffer from too long front wheel base.
You achieve small and short frames with free pedaling clearance as well as big and long frames with short front wheel base offering appropriate clearance between handlebar and seat.