On the R side, I think the answer is that all of the other candidates let Trump bully them, while a big percentage of the R base sought an alpha-male bully to fight for them. Trump isn't an alpha male, but he played one on TV and in his PR campaigns. On the D side, inexplicably the youngest voters have shunned the younger candidates. In 2016, the DNC and D elected leaders seemed to deliberately clear a free path for Clinton. She was opposed in the primary only because Bernie isn't actually a Democrat, so the party had no leverage over him. My theory (possibly of the conspiracy theory variety) is that this support from Obama and his followers was part of the bargain she made to encourage her supporters to fall in line behind Obama. For whatever reason, over the course of 8 years in office, Obama never seized control of the DNC and party apparatus from the Clinton hold-overs.
We've read a lot of criticism about how a very (historically) diverse Democratic Party primary field in 2020 -- male, female, young, old, black, white, Asian, Hispanic -- quickly whittled down to two very old white males. Election analysis said that black voters rejected the black candidates and voted Biden. Hispanic voters didn't line up behind a Hispanic candidate. Democratic women ended up supporting one of the two old males. Youth went for the very old Bernie, the rest of the electorate settling on Biden. A lot of talk of choosing a safe choice, the most recognizable names, guys who had campaigned nationally in the past, as policy took second place to simply beating Trump.
I thought a young, vital candidate would be an appealing and stark contrast to Trump, come election day. Now Trump gets to run as the young guy.
I can't see much other reason. There were numerous attractive young candidates, mostly moderate, but Senator Warren is very progressive and much younger than Bernie. Both Warren and Bernie fell away, because a big majority of the D electorate is not in the mood for revolution and knows that an even smaller part of the total general electorate is willing to line up behind radical change. A push for more moderate, slower change and a perceived better chance to defeat President Trump carried the day.
The other thing on the D side: for the first time in my memory, Clinton was chosen in 2016 because it was 'her turn'. There seemed some similar sentiment for Bernie this year. This has never been the Dem approach, I associate it more with the Rs, who did a 180-degree turn from this approach in 2016.
I'll certainly vote D, but no denying there is a horrifying amount of ossification in my party.