Thanos, the Mad Titan, sure did wipe out half of the human civilization on screen but a recent fan theory by u/Engineering_123 suggests that Loki might’ve been pulling his strings by giving him the idea of the snap. The dark lord who witnessed the destruction of planets due to over population sets out to exterminate exactly half of the populous in the universe with the power of the infinity stones. In the marvel comics Thanos has an unhealthy obsession with pleasing his confidante Mistress Death who is the manifestation of death itself, although in the movies it transforms into his desire of maintaining balance in the universe.
The theory makes a few assumptions following the crash landing of the ship of The Prince of Asgard. It depicts an interaction between Thanos and Loki, where Loki informs him about the resources that are available on his home planet that could aid his venture of maintaining balance in the universe. Thanos being aware of the might of the infinity stones places the Mind Stone in a scepter and hands it over to Loki to lead and command the destruction of earth. Also Loki must have mentioned the existence of the infinity gauntlet which could contain all the infinity stones in order to influence Thanos’ decision.
Loki’s intention is to destroy Earth, that falls under the domain of his brother Thor whom he resented since childhood. The theorist goes on to say that Loki wanted to prove his troth to Thanos by pledging to destroy earth with the help of a small army, after gaining his favor by telling him about the Tesseract. Subsequently Thanos obtains all the infinity stones and places them in the Gauntlet and with the snap of his fingers dissipates half of the human race.