I understand that each node has a transaction pool, which is used for adding transactions to the block. What happens to the transactions when a miner's block is declared invalid? Also, how are transactions removed from the local node's transaction pool once they are mined into the block?
Answering your first question: If the transactions in a block that is declared invalid have not been already validated somewhere else in the main blockchain, they will be returned to the pool of unconfirmed transactions from which miners mine. There is no loss of data.