I know that Autonomous Systems (ASes) used to be identified with a 16 bit number. It wasn't enough, so 32-bit ASNs were introduced.
The BGP routing table of BGP border router contains the IP address of the destination network and a series of numbers of ASes the packet will go through, starting from that router, in order to reach destination network.
If the BGP router R1 doesn't support 32-bit AS numbers, it will be represented as 23456 in the AS Path. Okay, but what if R1 is connected to multiple 32-bit ASes? If both are represented by the same number, 23456, how does it differentiate between them? It can't know where to send the packet because two distinct ASes have the same number in its routing table.
I think there's a new attribute, AS4_Path, ignored by 16-bit ASN-compatible BGP routers, that 32-bit routers take into account (brief explanation). But it doesn't explain how 16-bit ASN-compatible routers know the right way.