Specifically there are particular DHCP options (66, 67) that tell the client about this, and the client software (PXE) understands them:
* https://datatracker.ietf.org/doc/html/rfc2132
* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp...
* https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-pa... (RFC 5970)
And while the options previously were interpreted for TFTP use, newer PXE software now understands the use of "http[s]://" in the file name and use that instead of TFTP.