The Network layer (also called layer 3) manages device addressing, and determines the best way to move data
Routers (layer 3 devices) are specified at the Network layer and provide the routing services within an internetwork.
It happens like this:
First, when a packet is received on a router interface, the destination IP address is checked.
Then, if the packet isn’t destined for that particular router, it will look up the destination network address in the routing table.
Once the router chooses an exit interface, the packet will be sent to that interface to be framed and sent out on the local network.