How did Microsoft bought Nokia?

Hello! As we all know that Nokia now comes under Microsoft which means that they bought Nokia. My question is why exactly Microsoft bought Nokia? I mean Nokia was a very big mobile phone company, probably the biggest ever, then why would the owners be interested in selling it to another company? Why would Microsoft be interested in buying Nokia?
