DHCP Dynamic Host Configuration Protocol
The protocol that automatically assigns IP addresses to devices on a network.
When your phone joins Wi-Fi: it sends "who's the DHCP server here?", the router replies "me, here's your IP 192.168.1.42, you can use it for 24 hours". Then everyone knows.
The alternative is static IP configuration per device — impractical for more than a few.