Source: www.futureatlas.com.

Fannie Mae (FNMA 1.51%) and Freddie Mac (FMCC 1.63%) both reported second-quarter earnings that grew significantly from the same period last year, helped by rising interest rates, lower delinquencies, and strong performance of derivatives. However, investors aren't so happy about this news, since 100% of profits go directly to the Treasury. Here's what you need to know about Fannie and Freddie's profitability, as well as what's being done in an attempt to change the current arrangement.

A pretty strong quarter
According to the recent earnings reports from Fannie and Freddie, the agencies had a profitable second quarter. Fannie Mae produced net income of $4.64 billion, up 26% from the same quarter a year ago, and Freddie Mac earned $4.17 billion, a sharp increase from last year's $1.36 billion.

Both agencies benefited from rising interest rates -- the 10-year Treasury yield (which generally increases and decreases along with mortgage rates) increased to 2.35% at the end of June, from 1.94% at the end of March. Mortgage delinquency rates continued to improve in the second quarter. Fannie Mae's "serious delinquency rate" declined for the 21st consecutive quarter, and the percentage dropped from 2.05% to 1.66% over the past year alone. Freddie Mac experienced similar results in this area as well.

The end result of the second quarter is that $8.3 billion is being sent to the U.S. Treasury in September -- $4.4 billion from Fannie and $3.9 billion from Freddie. Since returning to profitability in 2012, Fannie and Freddie will have sent the Treasury $142.5 billion and $96.5 billion, respectively.

No wonder shareholders are upset
Unsurprisingly, many of Fannie and Freddie's shareholders are unhappy about the current arrangement, and who can blame them? After all, as of September the agencies will have paid back a combined $239 billion to the Treasury, far greater than the $187.4 billion they originally received.

Worse yet, all of those billions are simply considered to be "dividends" and have no effect on the outstanding principal whatsoever. In other words, Fannie and Freddie could pay the Treasury $1 trillion, and they'll still owe $187.4 billion.

In addition to sending off all of their profits, Fannie and Freddie are also required to gradually wind down their capital reserves, which several experts say could lead to the need for additional bailouts. As we saw during the financial crisis, undercapitalized institutions can easily run into trouble if conditions begin to sour.

Shareholders argue that since they held on to their investments while Fannie and Freddie were hemorrhaging money and left for dead, they should be entitled to share in the profits now that the agencies are back in the black. Many have also argued that if the government wanted to keep all of the profits for itself indefinitely, it should never have allowed the agencies' shares to continue to trade after the bailout.

Shareholders are suing the government. Will they succeed?
In an effort to change the Treasury's sweep of Fannie and Freddie's profits and allow the agencies to regain their independence, a number of shareholders -- including several high-profile hedge fund managers -- are suing the government.

A handful of similar lawsuits were dismissed last year, but a different judge is presiding over the remaining cases, and the trial is set to commence this fall.

Judge Margaret Sweeney seems to be a bit more sympathetic to the shareholders' dilemma, at least so far. She also appears to dislike the idea that the government plans to hold Fannie and Freddie in conservatorship indefinitely. She has refused to dismiss the lawsuits and recently ruled that all documents related to the agencies' conservatorship must be made available for discovery, which analysts have called a "big win" for shareholders.

Worth a look?
One thing is for certain: Even though no politicians or experts can seem to agree on anything involving Fannie and Freddie, most people are unhappy with the current arrangement. Fannie and Freddie were never intended to remain in conservatorship forever, and we've literally heard dozens of opinions on the best way to change that situation. And it's tough to make a case that the shareholders don't deserve anything for taking a chance on the failing agencies.

A thorough analysis by Pershing Square found that Fannie Mae and Freddie Mac shares could be worth at least $23, about 10 times the current price, if the companies were released from conservatorship and allowed to recapitalize -- and that includes the government's 80% stake.

The judge presiding over the shareholders' lawsuits seems to dislike the Treasury's profit sweep, which doesn't necessarily mean any money will be coming their way -- but I'm inclined to believe that the chances of a favorable outcome have to be greater than 10-to-1. Even so, I won't be throwing any of my money into Fannie Mae or Freddie Mac stock anytime soon. These stocks are still just one step above buying a lottery ticket, and investors shouldn't sink any money into these companies that they wouldn't take to a casino.