What does iptables -j REDIRECT *actually* do to packet headers?
Take a look at this answer: How does a transparent SOCKS proxy know which destination IP to use?
Quotation:
iptables overrites the original destination address but it remembers the old one. The application code can then fetch it by asking for a special socket option, SO_ORIGINAL_DST
.