Scenario:
You are running a bitcoind node and listening to the incoming blocks/transactions. You receive TX 1 which is put into your mempool. Block A is mined, and includes TX 1, which is subsequently removed from your mempool. Blocks B and C are mined, orphaning Block A. Neither Block B, nor C include TX 1, so it is put back into the mempool to be included in a new Block
Question:
How exactly does the node find out that it needs to include TX1 in the mempool again? Is TX 1 broadcast and received in the same way as when it was first broadcast to the node? Or in other words, if I'm listening for receiving incoming blocks/transactions, will it be relayed to me a second time or does the client "know" just to put it back in the mempool?
Let me know if any of my understanding is incorrect or if you need any more clarification!