IP routing is used to forward packets between networks using IP addresses. Routers use routing protocols like BGP and OSPF to learn about network reachability and maintain routing tables to know where to forward packets. BGP is used between autonomous systems to exchange routing and reachability information, prioritizing paths based on attributes like AS path length, local preference, and MED. Interior routing protocols like OSPF are used within an autonomous system.