How geek for geek tracks the signed in gmail to show the sign in popup?

How this things works. can you please suggest me some resources to learn a bit about this. TIA.