Cordless tools were a niche product, they could barely run an hour and they didn't have 1/10th the power a corded tool does. Things like cordless angle grinders didn't even exist because there was no way to get the required power to drive them.
You also have the advent of brushless tools recently which drive even more power to cordless tools. Smaller, lighter, more power and longer runtime. You put a cheap 18v Ryobi driver against an all metal housing Craftsman corded from the 80s, that cheap plastic Ryobi will outclass that Craftsman every time.
Some brands have risen and fallen. What's happened to Porter Cable is a shame. But conversely, how completely competitive a brand like Ryobi has gotten is also a near miracle. It's a great time for power tools!