How are transactions collected into new block?
The mempool as it is called, stores transactions that are propagated by the peer to peer network.  Miners have the ability to select which transactions they include in the block.  It is beneficial for the miners to collect as many transactions as possible so they can obtain the most amount of fees that they can.