Inicialmente, Loki não queria desistir do Tesseract. Quando Thanos primeiro pergunta a ele e a Thor, Thor até diz:
"We don't have the Tesseract" and that it was destroyed in the explosion of Asgard (or something along those lines.)
Loki não confirma ou nega isso, e Thanos diz:
That he's going to kill or maim Thor, and Loki mocks him and says, go ahead.
Thanos então prossegue para:
Torture Thor with the Power Stone. Loki suddenly breaks down, and hands over the Tesseract to Thanos. (Thor is surprised at this, and tells Loki, "You are truly lost, brother".)
No entanto, não pára por aí, porque
Loki tries to fool Thanos into convincing him to let Loki join his team, but as he steps closer to the Titan, he tries to kill Thanos with a hidden knife, and Thanos uses the Power Stone to stop him.
O seguinte não é explicado no filme, mas baseado na sequência de eventos, minha opinião é que isso é o que estava acontecendo na mente de Loki:
Loki gave up the Space Stone to stop Thor from getting tortured further. But he doesn't want Thanos to get the Space Stone either, and tries to fool Thanos into thinking that he wants to join Thanos' team, and brings up a hidden knife to strike at Thanos. But Thanos somehow sees this and stops him with the Power Stone.