It decides which path the packets will take i.e. it decides as to which router should the system pass on the packet to. Communication through the Internet takes place, using routers. Routers are basically systems, which connect two networks together. They are commonly used to connect an internal trusted network to the external un-trusted network called the Internet. ISP s use routers to connect you to the Internet.
Routers basically act as gateways to the Internet or gateways to external networks.
The Routing Table of a system besides holding other important useful information stores the router address to which packets have to be transferred, depending upon the IP Address of the destination. Let us look at the routing table of a typical machine to understand better. However, before we move on to an example of a routing table, it is important to understand what exactly the Internet Protocol or the IP Protocol does before taking its routing decisions. It is important to note that IP performs the above steps in the same order as they are written. It always looks for a matching host address before looking for a matching network address.