In more detail
When a device connects, it asks the DHCP server (usually the router) for a configuration. The reply lends it an address for a set lease time, along with the subnet mask, default gateway and DNS servers. The exchange has four steps, often remembered as DORA: Discover, Offer, Request, Acknowledge. The client tries to renew the lease when half of it has passed. DHCP uses UDP ports 67 (server) and 68 (client). Fixed addresses for printers or servers are set as reservations.
Why it matters
If no DHCP server answers, many systems give themselves a link-local address in 169.254.0.0/16 and have no internet access, a telltale sign of the problem. A second DHCP server on the same network, such as a stray home router plugged into an office LAN, hands out wrong settings and causes confusing outages.
Example
DISCOVER client broadcasts: any DHCP server out there?
OFFER server 192.0.2.1 offers 192.0.2.57, lease 86400 s
REQUEST client asks to use 192.0.2.57
ACK server confirms the lease
With a lease of 86,400 seconds (24 hours), the client starts renewing after 43,200 seconds (12 hours).