Following the events of Annihilation and the War of Kings story arcs, Oblivion, a cosmic entity of death, appoints Thanos as the new Avatar of Death. After a spat with the Guardians of the Galaxy, Thanos is captured and forced to work alongside the Guardians in preventing Lord Mar-Vell (the Avatar of Life) and his Cancerverse—an alternate reality in which death does not exist — from breaching the Fault and conquering their reality.
In order for the battle to end, either Thanos or Lord Mar-Vell have to die. No reality can have both the Avatar of Death and the Avatar of Life. Although he agrees to help the Guardians, all Thanos wants to do is die and reunite with his great love, Mistress Death. To do that, when the Guardians and Thanos confront Lord Mar-Vell in his Cancerverse, he allows Lord Mar-Vell to kill him.
However, in The Thanos Imperative, upon dying, Lord Mar-Vell unknowingly destroys his reality, as Thanos' death introduces the concept of death into the Cancerverse and Death herself comes to claim Lord Mar-Vell's soul. Unfortunately for Thanos, his beloved doesn't approve of his self-sacrificing gesture and instead resurrects him—only to be temporarily captured by the Guardians.
Once Thanos escapes, he flees to Earth looking for a Cosmic Cube, only to be captured by the combined efforts of the Guardians and the Avengers, and later transferred to the custody of the Elders of the Universe in Avengers Assemble #8. It looks like, at least in this case, Thanos lost twice—once to Lord Mar-Vell and once to the Earth's mightiest heroes.