How does ChatGPT's Memory works

I want to understand how ChatGPT knows when and what to pick up and store in memory.

I am intrigued by that feature.