In The Avengers (2012), Loki is sent to earth via a one-time bridge to the tesseract
(a powerful artifact recovered from Norway that we later discover contains an infinity stone).
His mission, presumably, is to recover the tesseract for Thanos, and his reward for doing so will be right to rule Earth. To aid him in his quest, he is given
another infinity stone,
and command of an army that will conquer earth for him once he uses the tesseract to open a second, more permanent bridge through space to allow them in.
Why? Why all this monkeying about with space bridges? We know from Avengers 3: Infinity War that
Thanos has ships than can travel vast distances in almost no time,
and we've seen similar speed from the ships in the second Guardians of the Galaxy movie. Why give an infinity stone to a god of mischief, and run the risk of his stealing or losing it (as indeed he did for time), when Thanos could have just flown over and grabbed the thing, or had his minions do so?