It doesn't work how you think. I don't work in CS I'm not qualified to explain it. It's literally better to just ask chatgpt how it works it will do a far better job than me. You can ask it to get as technical as you like. TLDR - it l