Two devices can exchange BGP routing information only after a peer relationship is established between them.
Because BGP uses TCP connections, you need to specify IP addresses for peers when configuring BGP. Two BGP peers are not necessarily neighbors of each other. Such BGP peers establish a BGP peer relationship through a logical link. Using loopback interface addresses to set up BGP peer relationships improves the stability of BGP connections, and therefore is recommended.
IBGP peer relationships are established between devices within an AS. EBGP peer relationships are established between devices in different ASs.