2.5 Hz was the standard in big pocket watches, with a big balance wheel. 4 Hz is the standard for wristwatches, with a smaller balance wheel.
You are right that it is an engineering compromise. Higher frequencies mean a greater acceleration of the balance wheel. The inertia of the balance wheel is itself a compromise with the strength of the main spring. You want to have a large oscillation amplitude, but also that the watch can self-start, and not too much pressure on the escapement's contact points.
5 Hz is, surprisingly, a big engineering gap especially with regards to lubrication: only dry lubricants work, and it was figured out (at scale) only in 1969 by Zenith with their "El Primero" movement (which is still in production and is a major milestone in watchmaking for many reasons, on top of having a crazy history).
But when Rolex decided to use El Primero movements in their second version of the Cosmograph Daytona, they reverted it back to 4 Hz to avoid having to retrain all the watchmakers in their vast service network.