It's a question of simple math why shorter barrels benefit from a faster twist rate to maintain stability despite their lower muzzle velocities.

A bullet needs a certain rotational velocity to remain stable thoughtout its flight.

I'm going to extremely oversimplify the physics because I am going to assume the bullet reaches full MV essentially as it leaves the cartridge.

In that case, the bullet's rotational velocity in revolutions/second is simply the product of the rifling rate (expressed in revolutions/inch) and muzzle velocity (in inches/second).