The Internet and your Router work the same way. Your router creates a LAN (Local-Access Network), while the Internet is a WAN (Wide-Access Network). But basically, they are the same. Both are just a network of computers talking to each other through an intermediary. For your own home network, you usually have one intermediary - your router. That router will assign you a "private IP address", or one that shouldn't exist on the internet, through DHCP. For most routers, this is 192.168.1.x, where x is a number from 0 to 255, usually starting at 2. Your router has an IP address in this network too, usually 192.168.1.1. These private IP addresses are NOT unique, as most routers use them.
Usually the reason that the Internet can't contact a computer is because the router doesn't know where to send the packet. Say you have two computers connected to the internet (hardware routers usually aren't smart enough to notice if you only have one computer connected anyway), and another computer on the Internet wants to access port 6969 on your computer. All this computer has is the IP address assigned by your ISP, since your computer's private IP address does it no good. So the computer contacts the router (since that's the device physically connected to the Internet), giving it a packet of data that says "this goes to port 6969". Well the router isn't a computer (or if it is, you closed off all ports like you're suppose to), so it needs to send this packet of data somewhere else. If you don't tell the router where the packet should go, the packet will just sit in the router's queue until it's deleted. Telling the router where a packet of data going to a port should go is called "forwarding".
Now a little more information. Routers modify packets (which are actually larger data split up and wrapped in routing information) enough so that when they return, the router knows where they should go. This is part of "Network Address Translation", or NAT. Then there's also the subnet mask, which tells the router how many parts of an IP address to consider "local". If your subnet mask is 255.255.255.0, then that means, if first three parts of your IP address match the sender's IP address (like 18.2.4.10 and 18.2.4.87), the router will consider both computers on the same local network and route accordingly.
Now why am I telling you all this? I don't know, I'm just bored.