A laptop joining a network does not initially know which IP address it may use. It also needs a subnet prefix, a default gateway, DNS resolver addresses, and other settings before most applications can communicate.
The Dynamic Host Configuration Protocol, or DHCP, supplies that configuration. A client broadcasts a request on its local network, a server selects an available address, and the client receives a time-limited lease along with network options.
DHCP is an application-layer protocol carried over UDP, but most of the information it delivers controls network-layer behavior. A wrong subnet mask changes which destinations the client considers local. A wrong gateway breaks off-subnet communication. A wrong DNS server can make a working IP path appear unusable.