There is a direction, there is one correct answer. The message returned by C must make its way to A, so there is an implicit geography where A is the direction of motion for the message. When C responded it included that context information. B picked up the context, which said that the original message was from B's connection to A, and used it to forward the response to the correct destination. This algorithm is called Stack Routing .
Every node has an identifier for each direct connection.
If A is connected to B, A's identifier for B is Ab and B's identifier for A is Ba. If B is connected to C, there are Bc and Cb. These identifiers are entirely relative to the node that owns the connection. There is no global association between Ab and Ba - they may not even use the same connection. For a message that moves from A to B to C to D and back again, routing information is stored in a stack as follows.