It works because on most domains, the DHCP server will give IP addresses to all computers that request them. It's not limited by MAC (physical) address. ISPs (cable or DSL) will almost always have a list of 'approved' MAC addresses. If a network card requests an IP, the ISP's server will check if the MAC address is an approved one. If so, it will work (note that on a lot of cable modem systems, you can make a 2nd computer work by giving it a static IP - takes some trial and error to find one that's not being used, but it can work for a while).
So basicaly, the answer is: Security. Most domains are protected from the outside, but not inside. The ISP is secured against giving IPs to non-approved customers.
A router will work, because it does NAT. It picks up an IP address from your ISP, then gives all your local computers "local" IP addresses, while using the "public" one itself. All traffic from inside the network comes through that router (hence that IP address) - in effect making it so that all the computers "share" that one IP.