Everyone dropped out of the race waaaaayy too soon. And why drop out?
Partly they dropped out to amass sufficient support behind Biden to ensure that he'd win.
The others dropped out because they were thinking that this was a normal primary where once a candidate has a clear path to victory there is little point in staying in the race.
Technically they will all have suspended their campaigns rather than ending them, so those campaigns could be revived if some candidate or other feels that they need to do so.
If Biden went away, it'd be like you'd have to have debates and a primary all over again.
Nope, ultimately what matters is the convention. The primaries are a colourful system that the parties have developed to inform the convention (and, probably more importantly, to ensure that they're running candidates who can sustain a national-level campaign attracting some kind of widespread support over several months). As important as all of that might seem, it is a by-product of the nomination process, not critical to it.
How does a contested convention work when there is no physical convention taking place
They're going to have some kind of convention, which means that they need to have some way of delegates voting in that convention.
All a contested convention is, in the end, is a normal convention except with more voting rounds and more people shouting at each other. If a virtual convention is possible, then a contested virtual convention is also possible, even if it might be extremely cumbersome.
Question for US Era
Has a nominee for the Dems or Republican ever stepped down right before an election?
Not US era, but also not sure why I'd need to be to answer this question.
The answer is kind of.
There's three precedents for this but the first two are quite old and not hugely relevant to today.
In 1872 the Liberal Republicans nominated Horace Greeley, who also got the support of the Democrats, but lost the popular election and then died before the electoral college vote. Since he had lost (by a huge margin), the parties who nominated him didn't specify a replacement for him, so no useful precedent was set. Some electors did vote for him, but these votes were invalidated since...well, he was dead.
In 1912 the Republican nominee for Vice President, James Sherman, died less than a week before the general election. The Republicans scheduled a meeting to be held after the election to select a successor, but after a pretty crushing election defeat, decided not to bother. The electors decided among themselves to cast their 8 irrelevant votes for someone else, but there was no official process, either legal or procedural, that they followed to make that decision.
The most relevant precedent was in 1972, when McGovern's nominated running mate, Thomas Eagleton, dropped out a few weeks after being nominated, after revealing he had been hospitalised for depression and stress several times in the 1960s. A new running mate, Sargent Shriver, was put in place by a special meeting of the DNC. A similar process would be used today if Biden dropped out (or died) post-convention.