Guess what? You do not need to buy textbooks if you have a smart professor that cares and isn't into the racket.
You can use 15% of a copyrighted work for educational purposes. That means you can pick and copy chapters from different books to cover the course material. All free!
It's an interesting question though. Because the publishers will invariably argue that each edition is different. If the editions are different, then surely you can get 15% of each.
The library, potentially. The other option that I've seen is that the professor buys one copy of the books and then copies the parts they want so they can distribute to the students.
You can use 15% of a copyrighted work for educational purposes. That means you can pick and copy chapters from different books to cover the course material. All free!