Billionaire investor Carl Icahn has been pressuring Family Dollar (FDO.DL) to put itself up for sale because he felt its management team wasn't up to the task of running the deep-discount operation. This morning, Dollar Tree (DLTR 0.71%) announced it will be buying its rival in a deal valued at $9.2 billion, including debt.

According to Icahn, Family Dollar has underperformed its peers and the S&P 500 on just about every metric over the past one- and three-year time periods and needed to get bought out -- and quickly.

The discount retailer had already recognized there was a problem in its business and closed dozens of stores, with plans to close approximately 370 more in the second half of 2014, while slowing new store openings in the future. It's also performed a C-suite shuffle, appointing a new chief merchandising officer in January and promoting an executive to the senior VP for merchandise operations position to replace the person who left in May. It more recently said it was turning to alcohol, not to wallow in its misery, but to boost sales. A limited test run seems successful, so it's rolling out alcohol sales nationally now.

All that apparently wasn't enough for Icahn, who took a 9.4% stake in Family Dollar and fired off a letter to its CEO demanding the company put itself up for sale. His preferred buyer was industry leader Dollar General, but the deep discounter threw spike strips in front of that plan when its CEO announced he will be retiring early next year. While this was not an impediment itself, companies usually don't switch executives in the midst of a major merger, and Icahn admitted that particular escape path might not be available any longer.

Both private equity and Dollar Tree were also seen as possible suitors, but at least one analyst didn't think the latter was a viable contender, because upon his review of the two dollar stores' asset bases, he found there was significant overlap, with nearly 50% of their stores duplicative. While he thought a better case could be made for Wal-Mart to buy Family Dollar, something I thought made sense, particularly since the mass retailer has made a point of opening very-small-format stores as a growth driver, it calls into question whether there will be as much synergistic savings as the teams suggest.

Under terms of the agreement, Dollar Tree will pay $74.50 in cash and stock, representing a near-23% premium to Family Dollar's $60.66 closing price last Friday. Shareholders will receive $59.60 in cash and the equivalent of $14.90 in Dollar Tree stock. The combined company will continue to operate both Dollar Tree and Family Dollar brands, giving them over 13,000 stores in 48 states, with revenues in excess of $18 billion. 

The deal will catapult Dollar Tree into the biggest industry operator, as Dollar General only has over 11,300 stores in 40 states, and had revenues of $4.5 billion last year.

Dollar Tree argues that benefits of the acquisition include complementary business models and products, including consumables and home goods; that it expands its demographic profile to include Family Dollar's low- and middle-income customers; and that it will be accretive to cash earnings per share within a year's time after the deal concludes. Perhaps, but if the analyst is correct about store overlap, it may have to worry about cannibalizing its own sales. 

There is some sense to the deal, of course, as the combined company will be able to better take on Dollar General, and Family Dollar's multi-price-point strategy expands upon Dollar Tree's own Deal$ concept, which sells items for more than $1.00. As there were just a little over 200 Deal$ stores as of the beginning of February, it wouldn't be surprising if some Family Dollar stores competing with Dollar Tree outlets change over to a Deal$ nameplate.

With both boards of directors having signed off on the merger, and Nelson Peltz agreeing to the transaction -- he's another billionaire investor with a sizable 7%  stake in Family Dollar -- it should otherwise be a done deal. There's plenty of competition in the space that antitrust opposition shouldn't be a concern, and the deal achieves what Carl Icahn set out to do, although he hasn't commented as yet on whether he supports it.

Although it looks like a good deal on paper, with its stock up 10% in premarket trading, some investors are thinking that, dollar for dollar, the merger makes Dollar Tree a better investment.