How Can You Track A Phone Without A Sim Card Installed?

I’m trying to figure this out too! Does the phone need to be connected to WiFi for tracking to work, or can GPS work by itself without any internet connection at all? I’m confused about how that part works.