can someone explain to me why some blocks have small size despite of the huge number of transactions waiting in the mempool?
Block generators are free to choose which transactions to include in their blocks. Among other things, their motivations to include a given transaction are influenced by:
- Its fee.
- Its orphan cost (related to its size as data).
- The effect on Bitcoin's reputation.
- For mining pools, their reputation among potential users.
Today, the block subsidy is so high and fees are so low that some block generators consider it profitable to produce empty blocks, minimising the possibility that their block will be orphaned and avoiding the cost of running a full node. Assuming appropriate difficulty adjustments, this increases the average time to first confirmation for all Bitcoin users.