The official Pi5 PSU is PD compliant. The Pi5 exchanges signals with the PSU. If it gets the correct response back, it "knows" that it can get 5A and sets the USB (output) current limit to 1.6A. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.