It is literally the difference between supply and demand and is determined by both.
For money, scarcity is demand induced. For cryptocurrency/money the number 21m or 100m does not matter as long as it's divisible.
For something like paintings, scarcity is supply induced.