For a number of years now, Yahoo and Microsoft have been courting each other. Yahoo has bee going through tough times and Microsoft trying to move more of its business into the search market. Having a failed ($47 Billion) bid to buy Yahoo last year, Microsoft probably gets want it wanted out of the new 10 year deal with Yahoo. Microsoft gets its Bing search engine to power Yahoo, with out getting the employees. Yahoo gets an improved engine for its search, and will handle the sales side of the online advertising engine.
Currently Google still rules the search with 65% of the search according to Comscore. Last year “Microsoft handled 8.4% of searches that month and Yahoo accounted for just under 20%.” WSJ