BGP - why is eBGP preferred over iBGP
The administrative distance (AD) of a route learned via eBGP is 20 while that of a route learned via iBGP is 200. This is done for a very good reason.
If a BGP router learns the same route from an eBGP neighbor AND an iBGP neighbor, it will always prefer eBGP based on the default AD. Why? Because if a route is advertised via eBGP, then it can never have originated within the local AS, therefore it considered the route learned via iBGP (from the local AS) as incorrect, or at least as less reliable. This is because of BGP's loop prevention mechanism which eliminates any routes that contain its own AS.
For example, if route 22.214.171.124/24 within AS1 is advertised to other ASes, any eBGP router that receives an advertisement containing this destination will remove it because it contains AS1 (its own AS) as part of the path. Therefore, because of this mechanism, it is considered impossible for an eBGP router to receive an eBGP advertisement about a route that is found within its own AS. Therefore, any routes advertised via eBGP are considered by default outside of the local AS. So if the same route is advertised via iBGP, it considers that less reliable than the eBGP route.