How do routing protocols like BGP and OSPF differ, and how do they manage path selection across large-scale networks?