We know that the bitcoin for mining a block is going to converge to approximately zero as the number of bitcoins will be almost constant after a certain amount of time. So, mining will no more profitable in the future and if no one is going to maintain the ledgers then how the bitcoin going to survive?
The fact that the reward to mine bitcoin will become less and less interesting over time especially in the long run is one of the major threat for bitcoin in the long run, there will be a point when there is gonna be almost no incentive to mine and so the hashing power might decrease rendering a 51% attack easier.
There is currently not a true solution but luckily bitcoin can be patch and there is lots of ideas on how to fix this threat.
This problem is called "tragedy of the commons" and here is a similar question from 7 years ago with lots of ideas , explanation and useful links:
You still have transaction fees. And if the transaction fees will be to high maybe something like that happens:
- With less incentive to mine, the transaction fees will drop
- Switch to PoS that does not cost so much energy