Microsoft was founded in April 1975, when the personal computing hobby was just beginning, and the Economist has an article on the company evolution to "middle age."
Microsoft began with development tools -- a BASIC interpreter and Pascal and Fortran compilers -- but soon moved on to Windows and later Office. Under Bill Gates, and later Steve Balmer, the company strategy was to "strengthen Windows, to make it ever more crushingly dominant." That strategy worked well during the desktop/laptop/on-premises server era, but it constrained Microsoft -- keeping them from purusing new opportunities on the Internet and mobile devices.
Current CEO Satya Nadella, shown below with Gates and Balmer, has a different strategy -- "just build stuff that people like."
That has led to the porting of Office to other operating systems and the Internet, support of open source and emphasis on their Internet platform, Azure.
The article constrasts Microsoft's middle age slump with Apple (founded in April 1976), which has passed them in profit:
and now accounts for a much larger percent of the US technology sector than Microsoft:
The Economist article is on Microsoft, but the fall from dominance of IBM, as illustrated in the above graph, is even more striking. IBM totally dominated the (smaller) technology market until a disruptive startup, Microsoft, led the revolution that toppled them.