What happened

Shares of mortgage company Mr. Cooper Group (COOP -0.04%) traded nearly 9% higher as of 10:21 a.m. ET Wednesday after the company reported earnings results for the second quarter of the year.

So what

In the second quarter, Mr. Cooper Group reported diluted earnings per share of $2.03 on total revenue of $599 million, both numbers that widely beat analyst estimates.

The company also grew its mortgage servicing portfolio to $804 billion and grew its tangible book value per share, or net worth, to $54.51, which is up close to 4% from the first quarter of the year.

"In addition to generating portfolio growth, servicing enjoyed higher profitability in the second quarter thanks to the rise in interest rates, while Originations did a fantastic job with customer retention, achieving and then exceeding our strategic recapture target and helping borrowers achieve their financial goals with cash-out refinancings," Chris Marshall, vice chairman and president of the company, said in an earnings statement.

Now what 

Mortgage servicing companies earn fees for collecting mortgage payments on behalf of third parties.

They perform better in rising interest rate environments because there is less refinancing activity and therefore not as many early paydowns of mortgages. This means more people are making mortgage payments, which means more fees for servicing companies.

Mr. Cooper Group has not only grown its servicing portfolio 23% year over year, but also expects to see pre-tax servicing operating income potentially more than quadruple from current levels by the fourth quarter of this year, so the company looks well positioned in the current environment.