This is called third degree price discrimination. It is a pervasive feature of economic life. Other degrees of price discrimination include second (harder to solve and more interesting!) and first (easy to solve but not so easy to implement in the real world). The author wanted a “supply and demand explanation” - that’s it.