Topology: client sits in a "private" network 10.20.1.0/24,
server in a "public" network 203.0.113.0/24, and gw connects
them (the router).
Without NAT: the server sees a request from the private IP 10.20.1.10
and answers back, but on the real internet 10.20.x.x is not routable,
so the packet is dropped at the first provider router. The same thing
happens at home: your ISP knows nothing about 192.168.1.5 and sees
only the router's public IP.
nat (Network Address Translation) on gw swaps the packet's source IP for its own public one, then restores it on the way back. In particular, MASQUERADE is dynamic NAT that takes the IP of the outgoing interface on its own.