The total output of the coinbase transaction of a block is normally the sum of the current block reward (which is newly created bitcoins) and the transaction fees from all the transactions in the block (which are not newly created coins, but are effectively being transferred from the users who made the transactions).
To put it another way, the following constraint is enforced for each block:
Total of tx outputs <= total of tx inputs + block reward
(normally it will be exactly equal, unless the miner has screwed up)
as well as the following constraint for each non-coinbase transaction:
Sum of outputs <= sum of inputs
You can see that the first constraint ensures that the number of "newly created" coins is no larger than the block reward (normally equal). Then, a non-coinbase transaction can grant a transaction fee by having the sum of its outputs strictly less than the sum of its inputs. The miner can then take the difference and add it to the coinbase transaction without violating constraint 1, thus collecting the transaction fee.
1The difference is transaction fees, which are collected by the block miner. – Greg Hewgill – 2017-08-29T01:20:49.587
So, transaction fees come from newly created bitcoin as well? Wouldn't they come from the source addresses for each transaction? – EdSanville – 2017-08-29T01:35:08.300
The rule is simply that the sum of all outputs in a block cannot be more than 12.5 + the sum of all inputs in a block. There is no real "from" or "to" fees - it's just the equation that needs to balance. – Pieter Wuille – 2017-08-29T07:58:40.240