How is mining associated to blockchain transactions?
How users / nodes see it:

When transactions are made, they stay in nodes' memory pools ("mempool") until a block that contains them, becomes mined and relayed. When this happens, that transactions become a permanent member of the blockchain (unless that block is orphaned).

How miners see it:

Miners' major incentives are block rewards. However, to maximize their profit, they can also include transactions in their block (According to BlockChair, 124k of 510k blocks include no transaction.) If they include transactions in their block, they'll be able to collect their transaction fees. That's why most of the blocks include transactions (and the miners who don't include transactions are mostly illogical).

tl;dr When miners include your transactions, your transactions become a permanent element of the blockchain. They do this to collect your transactions' fees, to maximize their profit.