Mainly because Linux concentrated on the Server side of things while windows and Mac focused on the user interfaces. And that attracted the regular users.
Since Linux is free, there was not a company promoting the software to make a profit vs Microsoft and Apple, so those companies acquired a large market share and the regular computer users got used to those systems.
Through the years, Linux has improved the User Interface(UI) for non technical users, but it is not promoted/incorporated into the the markets as Microsoft and Apple, even though Linux is better in so many aspects.
I started using linux around 18 years ago, I never looked back to windows again and I don't regret it a bit. But still it's a little technical.
Last but not least, Linux is the KING, the #1 in the Server world.