A scaling law of multilevel evolution: how the balance between within- and among-collective evolution is determined