There are several companies that are headquartered in Luxembourg. Based on the names of the companies, many of them probably originated in Luxembourg. This means that they started in Luxembourg. The owners of these companies started their businesses in their own garages or apartments. Then when their business expanded, they had to put the headquarters somewhere and they kept it in an office building close by.
However, there are a few companies that moved to Luxembourg and put their headquarters there. It seems that this was done because Luxembourg is a prosperous country and it has a lot of banking institutions. Usually, companies that move their headquarters to another country do that to make their company more profitable and it would be in a prosperous country.