There are certain technology, certain words that we hear often enough that they achieve a certain familiarity in our minds without us really understanding what they are. A router is one such piece of technology. You hear the word in the context of your home internet connect ("Make sure the lights are green on your router"). You may have heard about problems with routers at your place of employment. Perhaps a news article about problems with routers being attached and causing internet outages. It is time you know what they do.
A router is simply a piece of hardware - a very specialized computer - that is responsible for connecting computer networks and passing messages along from one network to another. The route messages on the internet ... hence the name ... router.
The internet runs on the back of an addressing scheme called IP addresses. There are IPv4 addresses - four numbers separated by periods, e.g. 22.214.171.124. Then there are the newer IPv6 addresses - a series of 8 hexadecimal numbers separated by colons (e.g. f3aa:2010:aac9:53b0:01a9:aacb:0001:f00a). These addresses, much like our home addresses, have meaningful structure that allows a message to get to just the right machine.
When a message leaves your computer, for example, when you request a web page, your computer will send a message to the router on your network. This message has the IP address of the destination computer attached to it. Your router will take a look at that address and see if it knows which computer is associated with the address. If it does, it will send it directly to that computer. If it doesn't it will try to find another router that is closer to ... or at least knows more about ... the address your message is attempting to reach. That router will in turn do the same - if it knows the address it sends it to the destination, otherwise it will pass it along to another router - again - one that is closer to or knows more about the address than itself. Thus each time the message moves from router to router (called a hop) it gets closer to its destination until it finally reaches it.
Let us say that you live on a fictional island of Malwaria. You need to send a letter, a request for some information, to someone in the United States - the address; 143 West Happy Street, Smartville, Indiana, United States. Being from this small island you know little of the United States but you do know where your local post office is. So you take your letter there. The postal carrier does not know much more about the United States, but she does at least know where the country is. So she puts the letter on a boat headed for the U.S. mainland. There it lands in the hands of someone that hasn't the foggiest idea of where Smartville is, but certainly knows where Indiana is ... and so your letter makes its way there. Once in Indiana, your letter sits in the hands of someone who knows little of the streets in Smartville, knows where Smartsville is. So he brings the letter to Smartsville where he hands it off to someone at the local post office. There a mail carrier, very knowledgeable of the addresses in the town takes the letter directly to 143 West Happy Street. The response will make it back to you in very much the same way.
This is very much how a router works ... but on a time scale of milliseconds. They are very simple, single purpose devices that when connected to one another allow your computer to communicate with other computers around the world - without really knowing where the computers are located.