On a high level, the entire bitcoin network is built on the fact that all of the nodes are following the same rules. The rules state that whoever hashes the next block gets to mint a number of coins, so they can.
From the Bitcoin white paper:
By convention, the first transaction in a block is a special
transaction that starts a new coin owned by the creator of the block.
This adds an incentive for nodes to support the network, and provides
a way to initially distribute coins into circulation, since there is
no central authority to issue them.
From the wiki:
Bitcoins are created each time a user discovers a new block. The rate
of block creation is approximately constant over time: 6 per hour. The
number of Bitcoins generated per block is set to decrease
geometrically, with a 50% reduction every four years. The result is
that the number of Bitcoins in existence will never exceed 21 million.