The block a miner is working on is known as a candidate block. They will build a candidate block from the highest paying transactions in their mempool, and attempt to mine it. Building a candidate block is not instant, as the miner has to calculate the Merkle root for all the transactions in that block, and so swapping out even a single transaction has a computational cost involved. Because of this, miners do not update their candidate block constantly with new transactions. They will attempt to mine their current candidate block, and meanwhile in the background they (or more accurately, their mining pool operator) will build a new candidate block, including new high fee paying transactions and dropping older low fee paying transactions. Once the new candidate block has been built, they'll swap from attempting to mine the old candidate block to this new one. After a set period of time, perhaps somewhere between a few seconds and a minute, which will vary between mining pools and will vary depending on how fast new transactions are hitting the mempool, the mining pool will create another new candidate block and the miners will switch to this one. The process constantly repeats until the next block is found, with miners always working on a subset of the highest fee paying transactions.