How Does a Transaction Get Broadcast to the Mempools of Different Nodes?
A transaction is first created and signed by the sender's wallet. The wallet then broadcasts this transaction to a few connected peer nodes on the network.
These nodes validate the transaction and, if valid, add it to their local mempool. They then relay the transaction to their own connected peers, and this process continues until the transaction has propagated across the entire network, reaching the mempools of all active nodes, including those operated by miners.