Gateway routers run both eBGP and iBGP.
When AS3 gateway router 3a advertises the path 'AS3,X' to AS2 gateway router 2c, AS3 promises AS2 that it will forward datagrams toward X.
BGP must select one route from several candidates.
Through iBGP, 2d learns that X is reachable through either 2a or 2c.
Hot potato routing selects the local gateway with the lowest intradomain cost.