Modern communication networks are built mostly on the concept of destination routing (although other concepts, such as source routing, do exist). In this concept, the sender of a data packet does not need to know where exactly to find the destination for that packet, all it needs to know is the address of the next router. This router will then decide, based on routing tables and the destination address of the packet, where to send it next (this is called the next hop). This process is repeated until the packet arrives at a router where the destination address is in a directly connected network, and the final router then sends the packet directly to that destination.
Routing decisions are usually based on routing tables, which can be influenced by many factors, such as available links, link quality, routing policies, QOS, etc.