Per Nordlöw:
Then how does the GC know when to release when there are multiple references?
The mark phase counts what's reachable and what can't be reached. If an object has one pointer to it, or one hundred pointers, it is not removed. If nothing points to it, it is removed.
I suggest you to read how a mark&sweep GC works, or better to implement a bare-bones mark&sweep GC in C language yourself for Lisp-like cons cells, you only need 100 lines of code or so to do it.
Bye, bearophile