Actually that's not true. They almost went under towards the end of the 90s. They diversified into buildable action figures called Bionicles, that came with their own tie in movie, and they signed their first ever merchandising tie in with Star Wars. If they had stuck with their core business of plastic bricks and original intellectual property they would have disappeared in the early 2000s.
They have subsequently branched out into movies (The Lego Movie is well worth a watch even if you don't like movies and made a box office fortune), licensed trading card games (2 on the go at present), licensed magazines (look in the comic section and count how many have the Lego logo on and a "free" toy on the front), more books than you can shake a stick at, and have created TV series to promote at least 4 of their most recent kids-oriented toy ranges (Ninjago, Chima, Mixels and Nexo Knights). They have even created their own Star Wars TV series to create their own toys in the Star wars universe.
Lego has also courted the adult collector market, through it's Ultimate Collector Series (UCS) brand, the Modular Buildings and its Architecture range. These are not for kids - prices are often North of £150.
They have licensed Lego elements to computer games for all their main franchise tie-ins. They also worked with the games development company to release Lego Dimensions, where you get to build the Lego toy and then see it come to life in the game. There are loads of toys you can buy to bring to life in the game.
The one thing the Lego Company did not do is focus on their core business. They have evolved into a multimedia company with very strong portfolios in numerous markets.