It’s probably more helpful to think about why money is less valuable now (has less purchasing power) than it did in the past. The government keeps printing or giving out more money to people faster than money is destroyed or taxed.
As something becomes more abundant, it becomes less valuable. Without a matching increase in abundance of goods and services to match how much more money buyers have available to spend, sellers will sell out of their wares faster then they can create them which creates empty shelves which means less money, so sellers have to raise prices so as not to sell out faster than they can meet demand.
If they don’t raise prices, someone else will use their abundance of money to buy them out of that product and then sell it to other buyers for an amount those buyers are willing to pay for it, which is called arbitrage.
Basically inflation happens because buyers have more and more money to spend, and if sellers don’t raise prices to match that, someone will buy them out and resell their products at the higher market value.
Latest Answers