3M interview question

How do garbage collectors work in Java?