In general, mempool is like an open wild market where transaction fees are the main exchange interest. The miners and users are the two types of players here. Miners are interested in validating the block with the highest total transaction MEV trading sum in the end. Users want their transactions confirmed in the following block by offering the highest possible transaction fee.
Mempool works as a “supply and demand” mechanism. When the demand for block space (number of requests to be confirmed) exceeds the supply (the number of transactions that fit in a block), miners select transactions with higher fees.
Mempool is also a “fee thermometer” and a “fee clock” for transactions. To avoid the situation of frequent transaction denial because of low fees, many services implement fee estimation algorithms that analyze the current state of the mempool and predetermine a lower level of fee for the transaction. If the mempool is overflowed with transactions with high fees, even the most expensive of them will take time to be confirmed.