Gamora: The entire time I knew Thanos, he only ever had one goal: To bring balance to the Universe by wiping out half of all life. He used to kill people planet by planet, massacre by massacre...
Avengers: Infinity War
Thanos: Little one, it's a simple calculus. This universe is finite, its resources finite. If life is left unchecked, life will cease to exist. It needs correction.
Avengers: Infinity War
Thanos: But at random, dispassionate, fair to rich and poor alike. They called me a madman. And what I predicted came to pass.
Avengers: Infinity War
And that theme of loss is continued when Scott Lang visits a memorial to the dead in San Francisco.
McFEELY We used to have beats in the script where there are those in every city. Millions of names.
MARKUS It’s that sense of collective trauma and the fact that if you weren’t killed, you wake up the next day — the trauma happened and I’m still here. How do we deal with this? That was the Stan Lee trick. Where’s the anxiety coming from? Now that they have Power X.
The New York Times, ‘Avengers: Endgame’: The Screenwriters Answer Every Question You Might Have