Thanos gets an Infinity Stone called the Power Stone by destroying the planet Xandar. He gets an Infinity Stone called the Space Stone by striking a deal with Loki in exchange for not killing Thor. He steals the Reality Stone from a person in space called the Collector, he gets the Soul Stone in exchange for killing his daughter Gamora. He strikes a deal with Dr. Strange to get the Time Stone in exchange for not killing Iron Man. He leads an alien invasion of Earth to get the Mind Stone from the robot superhero Vision by killing him. The Avengers, Spider-Man, Black Panther and the Guardians of the Galaxy all work together to stop Thanos. Thanos then snaps his fingers and causes half of all living beings on every planet in the entire Universe to disappear from existence. There is a scene after the credits where Nick Fury successfully tries to signal someone who can do something about it but he gets killed by Thanos's snap.