Mild Comic Spoilers related to Part 1 and backstory.
This movie is a modern retelling of the first half of Infinity Gauntlet storyline, streamlined to fit into the MCU. In the comics, Thanos comes back to life in the Silver Surfer comic and is in love with the personification of Death. To try and win her affections, he decides to kill half the universe. To get this level of power, he goes to collect the infinity gems and becomes god-like. He wipes out half the universe with the finger snap but Death spurns him because he is no longer his equal, but greater. Heroes try to defeat him and initially fail. Cosmic beings (doubt will be in the second movie) get involved, and much more craziness happens. I won’t spoil any more so you can either read the graphic novel or wait for the movie.
This played out over two years throughout Silver Surfer comic, The Thanos Quest two part series (where he gets the stones) and the 6 issue Infinty Gauntlet series. This subsequently spawned several follow ups (Infinty War, Infinity Crusade). The return of Thanos started out small and became an instant juggernaut, which made Marvel extend out the story. I love the Infinity Gauntlet as it is a classic and bonkers story. However, if you are looking for any even better read, get Thanos Quest as it is self contained (so you don’t need to be a comics geek), delves into the character of Thanos, and shows how he collects the infinty stones in very interesting ways. It is a few bucks on the ComiXology app and well worth the read.