It took off in comparison to other TTRPGs. In terms of the general entertainment market it was always a very niche thing. I’d argue that it didn’t take off and never became mainstream (it’s only now doing that). Video games took off; D&D didn’t.
I don't think it took off at first, but by the early 80s...it REALLY took off. I've never seen it be as prevalant as it was then. It literally was everywhere. I could go to the local toy store or department store and pick up D&D books and the latest D&D releases (you can find that now at Target and occasionally at some Walmarts, but you can't do it at most stores like you could D&D back when it was a fad).
Heck, later in the decade I could PICK UP D&D material at GAS STATIONS in the U.S. (of course, that was when comic books were sold at gas stations, and I'm talking about D&D comic books).
It drove an entire movie industry of fantasy movies INSPIRED (they couldn't say they were based off D&D, but it was obvious why they were being made, they were trying to make money off the ongoing fad of D&D...this is where a TON of your 80s B-movie Fantasy movies come from) by D&D. FAR MORE movies were inspired by D&D than anything I've seen as these days.
What drove it in popularity...hard to say.
If I had to peg it to something I'd say it may have been counter-culture and the drive of some groups to label it as a forbidden game. Forbidding anything to teenagers and college students seems to sometimes just drive their interest into the stratosphere.
It was similar to other fads that come and go (so, as big as some of the fads that you see that seem to be everywhere for a while...and then...they just...vanish). Unlike many others, it didn't vanish completely, but it lost how big it was.
If I had to point to something similar I'd say it was more like how Pokemon came and went (yes, it is still around, but for a while...it was just everywhere. Even if sales may be bigger today, it's cultural impact is nothing like it was a few decades ago when it was a fad).
Fidget spinners from last decade could be another example of a Fad like D&D was. For awhile it was easy to get one and they were everywhere. Now...it's a lot harder to find them unless you decide to go online.
D&D today is not the Fad it was of yesteryear. In some ways that is a good thing as it's probably not going to be the flash in the pan and then sink down into a bit of obscurity.