Sega used to be a large chunk of the market and they pissed away their share due to bad (or rather unfortunate) decisions... Lego is even worse, if you can believe that.
There was no competition to Lego a few years ago, then emerged Cobi, Qihui, Lepin and so on and Lego just failed to really do anything. They nickle-and-dime their customers, they shit out passionless products and have really assbackwards ideas on how to attract and retain customers. Meanwhile, Cobi and Qihui, etc. offer much more interesting products for smaller prices (the quality used to not be en par with Lego, granted, but the difference is almost non-existent nowadays).
Cobi has stuff like WW2 tanks and planes or battleships. Qihui has stuff like houses, racecar-models and so on.
Believe it or not, Lego has barely any interesting house-sets in their catalogue.
To make a long story short:
Sega was a big player in the video game market, but they made a few bad decisions and lost their share against another strong brand.
Lego used to be the ONLY player in their market, and utter incompetence has opened the door to literal nobodies to take away Lego's market. There was no competition, but Lego's incompetence allowed competition to grow like mushrooms in a forest after a late summer rain.