An ethernet router is an layer three device on the ISO-model.
An ethernet router connects multiple separate networks together. Making it able for hosts in two or more totally different networks to communicate with each other.
In simple terms, a router has table of different destination networks. When traffic passes the router it’ll look for the most specific route to forward the traffic to. If none are applicable, it’ll use the default route. (0.0.0.0/0)
Look at the image to the right:
Each colour is network, where black is then destined to the internet. As you can see, the router will forward the traffic based on the destination.