Here is a more in-depth article on how it works, using pointer coloring.
https://www.programmersought.com/article/29543432001/