Agents of S.H.I.E.L.D.'s final season saw the team trapped in an alternate timeline, but they ultimately managed to use the Quantum Realm to travel back to their own reality. However, upon landing in 2020, it was clear Agent Coulson and company were in a world where Thanos' attack on Earth could have never happened (S.H.I.E.L.D., meanwhile, was totally absent from Avengers: Endgame).
Despite that, showrunner Jed Whedon has explained in an interview with The New York Times that there were originally plans to reference the Mad Titan's actions in Avengers: Infinity War.
"Some of the stuff they did with time travel in 'Endgame' indicated that there are other timelines where other adventures are occurring," he explains. "We’re following the multi-verse rule. The only way that someone survives Thanos’s snap in the movies is go into the quantum realm, and we originally did plan to give that a mention — because we used the quantum realm to move between timelines — but it got cut for time."
The team being in the Quantum Realm/an alternate timeline would certainly explain why none of them disappeared, but it doesn't address why the 2020 they landed in was such a hopeful place, clearly not affected in any way by half the population having gone missing thanks to Thanos.
Ultimately, it seems easier to just assume Agents of S.H.I.E.L.D. always took place in an alternate timeline following the events of The Avengers, especially as the movies have never referenced the TV show. If any of the characters return, then we'll obviously know otherwise, but it's hard to say for sure.
What do you guys think?