It is based on the assumption, that you have 3 types of objects in memory: temporary ones that you do not need after leaving small scopes like methods. long lived ones that you store in data structures intended for long timespans in the life of your applications and some objects, like the class definition itself, which will be never removed. It then turns out there are different methods available to manage the memory and for each one there seems to be a better one: For the young, it seems worth only to save the objects that live longer (called survival/promotion). After that you can clear that whole region. (This is called copy-collection) For the old, you are likely to remove just a few, so you go trough all objects you have and just deal with the ones you no longer need (called sweeping) and for perm, well you don't do anything.
Of course in reality it gets quite complicated, but this model is quite established and works well for many scenarios.