During installation, DHCP is used to discover the network setup. This includes the IP address as you noticed, but also the subnet, default gateway, and optionally the domain name and nameservers. All the available information is used to set the network up and is stored in the appropriate files for future reference (
resolvconf package can be used to maintain
/etc/resolv.conf when changing networks. Network Manager can also manage
/etc/resolv.conf. Both programs read the information made available by the DHCP server when configuring a network interface, in a similar fashion to the installation program.
You'll find all this and more described in detail in the Debian wiki.