How does the mathematical problem get harder for bitcoin mining over time? How does it become harder for miners to extract bitcoin as time passes (excluding increasing computer capabilities and the competition between miners accordingly)? Is related to the amount of bitcoins that could be extracted at that timestamp?
The Bitcoin blockchain has a property called the "difficulty" or "target", which is expressed as a 32-byte number. For a new block to be valid (among many other things) it's hash (another 32-byte number) must be arithmetically less than the target. This target value is adjusted after every 2,016 block period by a deterministic algorithm performed by all full nodes on the network.

Imagine if I asked you to flip a coin and if you got 3 "heads" in a row you win. How many attempts would you need to win? Once you win, I change the difficulty: now you must get 4 "heads" in a row... that will be harder for you and require more "computation" (attempts).

In Bitcoin, the difficulty adjustment algorithm looks at the time stamp of the block at the start and end of the 2,016-block period. If that time is greater than two weeks, the new difficulty target becomes "easier". If the blocks are being mined too fast, the difficulty becomes "harder".

further reading: Where exactly is the &quot;off-by-one&quot; difficulty bug?