Exabyting interview question

What is garbage collector? How does it work?