Why is such a small country neighbored by much more powerful ones for quite some time now still a country? Is it because of alliances or what. Has it ever contributed benefits to any other country?
In brief, Luxembourg was annexed by Nazi Germany during the Second World War. Nazi Germany then lost the war, and the stated war aims of the Allies included, essentially, liberation and restoration of conquered areas of Europe. So Luxembourg regained independence and sovereignty after liberation, and there hasn't been a major war of conquest in Europe since.
For its small size, Luxembourg is also a pretty wealthy country, so there has not been a need or desire for some sort of voluntary annexation by another country, which is about the only other reason I can think of for them to hypothetically surrender their existence.