How does a packet reach its destination?

Solution 1:

In a nut-shell, when a router doesn't know how to route a packet it'll send the packet to the default gateway/the next "hop".

Basically, when your router can't find a valid rules (or more formally, it's route table) it will send the packet to the default gateway, which will typically send it upstream to your ISP.

Once the packet arrives at your ISP's routers, much like your own router, they will have their own route tables. But this time they'll be more detailed. Knowing about other customers and other ISP's.

This will continue on until the final router that has the final destination rule attached to it, sending it onto the specific computer/Interface.

All along this way, the packet includes source information indicating where the original packet came from. Your router (likely, with NAT) would had converted this source information from your local machine's internal only IP address (e.g. 192.168.1.25) to your WAN IP address given to you by your ISP (e.g. 121.147.148.55) and this WAN IP will be what's contained within the packet's source information.

Thus, all the upstream routers can simply perform the same routing as above, but in reverse to send your packet back to you. However, once it reaches your router. Your router has it's own special rules to know that that certain packet should be forwarded back to your local machine with it's internal only IP address. This is called Network Address Translation.