The cost for a transaction are trivial for an actor but expensive for the network. Transactions fees are used to compensate a network for the costs the transaction creates as well as to increase the costs of conducting a Denial of Service (DoS) attack. In the long run, on efficient, robust and vibrant networks you would expect that the fee for a transaction to equal the network cost for carrying that transaction.
Miners listen for transactions on the network and receive a fee for including a given transaction in a block. As such, higher transaction fees increase the likelihood that a transaction will be included in a block. However, this process also imposes costs on the network since every new block must be replicated on every single node. To incentivise miners to add valid transactions to the network whilst not abusing their position a number of potential solutions exist:
- Proof of Work increases the cost and difficult of adding new blocks as used by Bitcoin
- Proof of Stake makes miners commit some of their own resources as an indication that they will behave responsibly
- Only use trusted miners is an approach adopted by Ripple and Stellar
- Limit the number of blocks any single miner can add