Your Internet service provider has a Dynamic Host Configuration Protocol server that assigns IP addresses based on modem MAC addresses. When your modem connects to the network, it indicates that it is looking for an IP address. The DHCP server detects this communication and begins communicating with the modem.