Same way it happens with non VPN setups.
Network Address Translation. Your personal device is assigned a private IP (likely from RFC1918 or 100.64.0.0/17 range) and that is unique to you for as long as the VPN tunnel is established.
When the traffic leaves the public VPN endpoint it will be translated into a public address. All the website you are trying to access will do is respond to the public IP and there will be a translation table at the VPN provider saying which private IP to send the traffic.