"How did Nokia die", - the iPhone presses from above, the whole crowd of cheap Chinese smartphones presses from below. It is difficult to survive in such conditions. Apparently the example of Motorola inspired them to leave this business segment. By the way, Nokia is a diversified corporation, they were engaged not only in mobiles, so they are alive and apparently hold out for some time.
" why did Microsoft buy it ", - Mirosoft wanted its own upstore. Apparently buying a Nokia was cheaper than developing something of your own. Now Microsoft has its own semblance of an upstore, and some managers have received good bonuses. And almost everyone is happy.
As far as I remember, Microsoft bought out Nokia because of its many patents. After gaining "control" over them, the company ceased to be necessary for the IT giant from Redmond. By the way, I would not say that the Finns were doing great with sales: they could not bring OS Symbian to a competitive level and switched to Windows Phone, which was going through hard times both then and now.