A router, as its name implies, routes network traffic between an outward facing link and 1 or several machines connected to it. This allows multiple machines to share one network connection. The router keeps track of which packets are meant for which machine and passes them through to the appropriate port.
A router is different than a switch or a modem, although many modems contain routers and switches. :-)