Thanos has gained full-on omnipotence no less than three times in the Marvel universe. This essentially means that he was, by far, the most powerful being in existence. He was unkillable, unharmable, could use any superpower imaginable to infinite levels and make anything happen with a single thought - and he was defeated every time. Why was this? Well it's because he secretly wanted to lose - and the reason for that is because he deems himself unworthy to be the supreme ruler of the universe. He's actually quite humble deep down and has, on a couple of occasions, attempted to live the simple life. He did so by becoming a farmer on one of those occasions and by attempting to become a do-gooder on the other occasion. Neither attempt lasted long and he went back to his old ways - striving for power before subconsciously letting himself be defeated on purpose.