RIM put itself in a terrible position in the market in the past couple of years, by not listening to all the signs that the market is shifting to touchscreen phones. Not only RIM still doesn't know how to make a good touchscreen, but its current gen OS is completely inadequate for the touch screen era.
RIM planned to launch the QNX-based OS for smartphones, called BB10, at the end of this year. But then, further delays appeared along with some poor excuses, and that's how BB10 got delayed until early 2013. This means that RIM's new operating system is very late to the party and has almost no ecosystem, which makes it very hard for RIM to recover.
This may be why RIM is willing to license out BB10, in order to get more people on board, and then more developers willing to make apps for it:
“We don’t have the economy of scale to compete against the guys who crank out 60 handsets a year,” Heins (RIM CEO) said. “To deliver BB10 we may need to look at licensing it to someone who can do this at a way better cost proposition than [we] can do it.”
A Wall Street analyst, Peter Misek from Jefferies, thinks that this partner will be Samsung, as the Koreans have been trying to create a successful alternative to Android. Bada and WP7 have failed to bring in significant sales, while Tizen is still in production, and it's doubtful it will gain any traction at all.
Samsung may hope that BB10 would give them better access to the enterprise market, which is a very lucrative market. Conquering just a tiny piece of the enterprise sector would significantly increase Samsung profits.
Samsung may also be looking into buying RIM, which is probably a better idea, if they can afford it, as that would give them instant access to all existing RIM customers:
“We believe Samsung is considering ramping up its internal OS [operating system] development efforts, licensing BB10, or buying RIM,” he wrote. “We think any acquisition is unlikely until after BB10 launches.”
Samsung may want to wait and see if BB10 gains any traction before they buy RIM, because otherwise, it could be a dud. Also, I don't think Samsung would want to buy RIM just to replace Android, although that's certainly possible as well. Most likely they just want to have some kind of leverage against Google.
Of course, it's not the first time that rumors about a possible buyout of RIM (or Nokia, or other faltering company for the matter) surface. These rumors tend to lift share value of the target companies, so one might suspect a vested interest here. Take with a grain of salt.