A modem is a device that connects to an ISA through a transport medium. This transport medium could be a cable Internet, a phone line, fiber optic, or fiber. A router, on the other hand, is a gateway between your WAN and LAN. It provides NAT and allows multiple devices to have their own local IPs.  In similar terms, a router connects to a modem for creating a private network in the home, office, etc. When you connect a device to a Wi-Fi, it connects to the local router.