I don't think I understand it well enough to explain it simply.
You might say the Bitcoin code counts the number of blocks in the chain and accepts new blocks that have the correct mining reward in them based on that chain length.
Everyone running the same code makes sure that everyone accepts the same blocks and builds the same copy of the chain.
And in that process of only accepting blocks that lead to that slowly shrinking miner reward, the network as a whole imposes a cap on the total number of bitcoins that can enter the system.
🫠