It’s an important social event for teenagers. It affords a time for teens to dress up and look extra nice and make some coming of adult age decisions like asking your crush to dance, abstaining from peer pressure, etc.
It’s an event for teens to be feel special, have fun and to exercise self control. College comes quickly after and a lot of them are studying for finals and so on so it’s a good way to blow off steam.
Ultimately, just another cultural implementation. Other countries have similar events I can only imagine