The market
The supply is controlled by not having competition, the demand is imposed, captive, if you will.
When I was a poor grad student, I'd go to the library and get the previous version of a textbook, but I had to do it fast.
The article I really want to read, I happily pay for, but not thirty dollars. The research that went into it was not paid for by the publisher. Some of it was done through grants from the government. The figures were created by the authors. The formatting is done by the authors. There are journals that you have to pay to submit.
It's a racket.
https://www.vox.com/the-goods/2019/3/6/18252322/college-textbooks-cost-expensive-pearson-cengage-mcgraw-hill
