When a host sends a packet to another host; it will use host routing table where to send the packet. If the destination host is not on the same network, as a result, the packet is forward to the default gateway. When a packet arrives at the default gateway, which is generally a router. So the routers consult its routing table to decide where to send this packet. The routing table of a router has information about:
Directly connected routes
These routes come from the router active interfaces. Routers add a directly connected route when configuring an interface with an IP address and activated. Each of the router’s interfaces connects to a different network segment.
The figure identifies the directly connected networks and remote networks of router-1. Networks in the red rectangles are directly connected networks for router-1 and network in the blue rectangles are a remote network for router-1 and vice versa.