D&D Beyond and Roll20 are completely different animals.
D&D Beyond is an online tool for digital management of D&D content. WotC (for whatever reason) doesn’t sell PDFs of its books. Nor does it maintain a System Resource Document for D&D, unlike most other RPGs. (Caveat: The Basic Rules are available as a free PDF and through an SRD, but that only gives you the, well, basic rules and a small subset of races, classes, and monsters).
Instead, if you want a digital copy of the material, you have to subscribe to D&D Beyond, and then buy the digital copy, which generally costs as much as the physical book. I personally think it’s a terrible set-up, but a lot of folks like it. One big advantage is that you’re not getting separate PDFs for each book - you’re getting a single, integrated, searchable digital document/user-friendly database, which incorporates all of your purchased material.
It also has digital character sheets which integrate all of that info. So, you don’t need to keep looking up your class features or spells or magic items - just click on it on your character sheet, and you see the write-up.
But, none of that directly lets you play online - it just puts the information at your fingertips.
Roll20 is a “digital tabletop” that lets you and your players share a common map, tokens, art assets, dice rolls, etc. But, it doesn’t actually come with any of that - you have to purchase all of that stuff separately.
It’s my understanding (but I have NO experience with it) that D&D Beyond has a native capacity to interface with Roll20, so if you have bought material on D&D Beyond, you can import it into your Roll20 account. But! D&D Beyond, again, isn’t a digital tabletop. If you have maps and art you got through D&D Beyond, they won’t be formatted to be usable as playable maps and tokens on Roll20. You can, though (I think), bring character information over, so that if you built a character in D&D Beyond using material you bought through that service, you can create that character for a game in Roll20 and keep the info. I think.
So, you might wind up buying a physical book from WotC. Then buying that same material in digital format through D&D Beyond. Then buying that same material AGAIN through Roll20.
BTW, as to your comment about what you’re getting for the money, keep in mind you’re not just getting the written information, you’re getting maps and tokens and other assets that are already formatted and ready to plug’n’play in a virtual tabletop. You actually don’t need that - you can scan and import and format the maps from the books yourself, and make tokens using artwork online, but it’s a LOT of work.