Yes, of course, supply and demand. But let me make a few comments on manufacturer costs. Newer IC's are typically built on newer fabs which can fit more transistors in a smaller area. Because of this, they can get many more IC's from a given amount of silicon. So the manufacturer cost is higher on older IC's. This is very significant. In competitive markets, high volume customer pricing asymptotically approaches cost of materials + some thin margin.
In addition, many manufacturers don't really like to keep old "legacy" fabs up and running. They only have a small number of customers buying the output of those fabs. So the price goes up. Those customers don't like paying the high price, so they eventually find a way to design in newer parts. This means that the number of customers shrinks even more, forcing the supplier to raise prices even more to make it viable. It is kind of a negative spiral. Eventually, it will simply not be worthwhile, and the manufacturer will announce an end of life date and a last time buy date.
The types of customers who buy "legacy" parts despite very high pricing are those who simply cannot modify the design. Nuclear power plants. Aviation. Some types of industrial equipment. If you have an electronics component that has been tested extensively over a very long time, running in a mission critical application, the cost of validating a new component may be many millions of dollars. Long before it finally retired, the space shuttle was shockingly obsolete.