How does the song level system even work?

Like, what makes a level 24 a level 24 and not anything else. I thiught it was difficulty but I can clear more 24s and 25s than 22s and 23s. Is it about the technicality? So like, spam notes and hold notes? Or the BPM?