user132877: I'm a bit new to blockchain and I am trying to understand.
As I understand when a new transaction happens it's added to a mining pool and miners prioritize these transactions (for example by amount of fee) and select some transactions to add them to block (max 1MB).
But it's also possible for some block to be empty (without transactions).
So, if some blocks are empty, does this mean that new block creation starts at certain times? (Does it have some schedule like every 5 min or something like that?)
Or does something trigger miners to create a new block?

user5406: The flow of a transaction is like this:

Users create and submit transactions
Nodes gossip the transaction in the network, validating them, adding them to their mempools and forwarding them
Miners select transactions from their mempools to build block templates
A new block is found that includes the submitted transaction and the transaction is confirmed

Miners mine continuously—each of them is always trying to find a new block. A block is found when a block header hashes to something that is lower than the difficulty target. There is no way to know whether a block header candidate is a valid block until it is hashed. Since every miner is trying to pay themselves the mining reward, they all have unique block templates (as their transactions don't match, the Merkle root of the transactions differs). This means that every miner is searching previously unseen block candidates and finding a new block essentially comes down to an independent random event with a minuscule chance for every block template. Sometimes it only takes seconds for a new block to be found, and sometimes it takes more than an hour. The difficulty retargets automatically to keep the expected block interval to about 10 minutes.
Miners continuously update their block templates whenever they hear about new transactions. As you said, they pick the transactions with the highest feerates, to build the block template that will collect the most fees.
When miners hear about new blocks, they briefly use an empty block template that doesn't include any transactions. The miners do this to avoid including a transaction that the previous block already included which would make their new block be in conflict and invalid. As soon as the miners have processed the previous block, they build a new block template with transactions again and use that. So, we usually only see empty blocks if a new block is found seconds after a previous block, or if there are actually no transactions waiting to be confirmed.

132877: <p>I'm a bit new to blockchain and I am trying to understand.</p>
<p>As I understand when a new transaction happens it's added to a mining pool and miners prioritize these transactions (for example by amount of fee) and select some transactions to add them to block (max 1MB).</p>
<p>But it's also possible for some block to be empty (without transactions).</p>
<p>So, if some blocks are empty, does this mean that new block creation starts at certain times? (Does it have some schedule like every 5 min or something like that?)</p>
<p>Or does something trigger miners to create a new block?</p>
 5406: <p>The flow of a transaction is like this:</p>
<ul>
<li>Users create and submit transactions</li>
<li>Nodes gossip the transaction in the network, validating them, adding them to their mempools and forwarding them</li>
<li>Miners select transactions from their mempools to build block templates</li>
<li>A new block is found that includes the submitted transaction and the transaction is confirmed</li>
</ul>
<p>Miners mine continuously—each of them is always trying to find a new block. A block is found when a block header hashes to something that is lower than the difficulty target. There is no way to know whether a block header candidate is a valid block until it is hashed. Since every miner is trying to pay themselves the mining reward, they all have unique block templates (as their transactions don't match, the Merkle root of the transactions differs). This means that every miner is searching previously unseen block candidates and finding a new block essentially comes down to an independent random event with a minuscule chance for every block template. Sometimes it only takes seconds for a new block to be found, and sometimes it takes more than an hour. The difficulty retargets automatically to keep the expected block interval to about 10 minutes.</p>
<p>Miners continuously update their block templates whenever they hear about new transactions. As you said, they pick the transactions with the highest feerates, to build the block template that will collect the most fees.<br />
When miners hear about new blocks, they briefly use an empty block template that doesn't include any transactions. The miners do this to avoid including a transaction that the previous block already included which would make their new block be in conflict and invalid. As soon as the miners have processed the previous block, they build a new block template with transactions again and use that. So, we usually only see empty blocks if a new block is found seconds after a previous block, or if there are actually no transactions waiting to be confirmed.</p>
