The reply is generated by the server in question, using information available to it.
Essentially, the point here is that WhatsApp is "clicking" the link (to generate a preview) with a resulting connection from the client's device, without user interaction.
So you can send a link to a server you control and harvest the recipient's client device IP, without the need for them to click on it.