Ebooks may not sell out, however publishers can set availability time periods. I’m just using this as an example from another digital domain, but Nintendo just released Super Mario 3-D All-Stars on the Switch in September, and said that both physical and digital would only be available until March 31, 2021. After which point both versions will be discontinued. However, after March 31if I want to, I would still be able to track down the physical version to play whereas digital, I’m out of luck.
Same with book, an e-book could be released and only out for a short time before being discontinued by the publisher or removed because of legalities or whatever. But a physical book, even if it’s out-of-print, can usually be tracked down and read, either by buying second hand or getting it from you local library or through inter-library loan.