How Does a Node Manage Its Mempool Size?
Nodes typically have a configurable limit on the total size of their mempool (in MB or number of transactions). When the limit is reached, nodes use a policy, usually based on the lowest fee-per-byte, to evict transactions to make room for new, higher-fee ones.
This ensures the mempool remains manageable.