There are 2 main ways that routes get added to the routing tables or routers.
The first way to use static routes
where an administrator manually adds a route to the routing table
and the second way is to use dynamic routing protocols.
So with static routes, you as the administrator are adding the routes to the routing table.
The advantage of this method is that there is no overhead
on the network, in that, they are no keepalives
or constant routing updates sent between routers.
RIP or Routing Information Protocol which is an older routing protocol
sends it entire routing table every 30 seconds.
So when using static routes rather than RIP that overhead is removed.
More modern routing protocols such as EIGRP and OSPF
remove this constant updating that took place in RIP every 30 seconds
but they still send hello's and keepalives
on the network which consumes bandwidth.
With static routes that is removed
but the major disadvantage of static routes is that you as the administrator
have to update the routing table
which could be a lot of work if you have a large network.
Static routes do not automatically taken to account changes in the network
you as the administrator would have to manually update
the routing table on a router or multiple routers if a link went down
so the overhead is not on the network
the overhead is on you as the administrator to keep everything updated.
Static routes do not scale when networks become large.
The amount of work involved in keeping routing tables updated manually is just too great
especially when there are lots of topology changes.
Static routes do not update routing tables
when topology changes in most cases.
Now that being said, it is possible these days to monitor IP addresses
and for example to remove a route from the routing table
if an IP address is no longer available.
So it's possible to implement some dynamic options with static routes
but the overhead is still large and static routes are cumbersome in large networks.
Now static route are still used in lot of networks today
the most common example is a default static route
your home a DSL or cable or fiber router
will typically have a default route to your service provider.
So your home router doesn’t know about the routes on the Internet
it's simply forwards the traffic to your ISP
a default route in a router's routing table basically tells the router
when you don’t have a specific network for traffic
that you receive in your routing table simply send the packets to the router
that’s configured as your default gateway or gateway of last resort.
So when you configure a default route on a router
you are pointing it to another router
which means that router will simply send that traffic to that default gateway
when it doesn’t have a more specific route in the routing table.