At the end of Avengers: Infinity War half the people (including heroes and villains) in the universe were gone in the snap of a finger from Thanos (Josh Brolin).
Click here for original story, Avengers: Endgame exploits time travel and quantum mechanics as it tries to restore the universe
Source: Phys.org