Investment banking giant Morgan Stanley (NYSE:MS) is rising after announcing its second-quarter earnings Wednesday, and rightfully so. Not only did the bank reveal excellent numbers on both the top and bottom lines, but the investment banking and trading results were also a big positive surprise. Here's a rundown of the key numbers investors need to know, and why the market is reacting so positively to the report.

The headline numbers

As I mentioned, Morgan Stanley exceeded expectations for both earnings and revenue. The bank's earnings per share soared by a staggering 49% year over year to $1.30 and were significantly higher than the $1.11 analysts had been looking for.

Stock traders talking in room full of monitors.

Trading revenue was a particularly strong area of Morgan Stanley's earnings. Image source: Getty Images.

To be fair, the lower corporate tax rate that took effect this year is responsible for much of the increase. Having said that, a 49% earnings boost is the best among all of the big banks that have reported so far, so a good portion of this is due to growth in Morgan Stanley's business itself. We'll get into the specifics in the next section, but at least some of the earnings gain can be attributed to the 12% revenue growth the bank produced -- also the best among the big banks so far.

Mostly strong results

Looking beyond the headline earnings and revenue numbers shows pretty impressive results, particularly in the bank's institutional securities segment, the largest part of the business. This contains the key investment banking business, as well as the bank's crucial trading revenue.

Investment banking revenue soared by more than 20% from a year ago on strong M&A activity, and a big jump in equity IPO underwriting revenue.

The X-factor in the report was trading revenue. This is what really separates Morgan Stanley's second-quarter results from those of fellow investment bank Goldman Sachs (NYSE:GS), which reported generally strong earnings the day before, while trading revenue simply matched expectations.

In Morgan Stanley's case, trading was arguably the strongest part of the report. Trading was expected to be roughly flat from the same quarter a year ago. But equities trading revenue came in at $2.5 billion, which was roughly 9% more than expected, and bond trading revenue of $1.4 billion also beat estimates by 9%.

From a profitability perspective, Morgan Stanley generated a 13% return on equity (ROE) for the quarter, well ahead of the 10% industry benchmark and up tremendously from 9.1% in the second quarter of 2017 -- mainly due to the benefits of tax reform.

Not all great news

While Morgan Stanley's trading and investment banking revenue was excellent, the same cannot be said about the firm's other two business segments.

Wealth management revenue grew by more than 4% to $4.33 billion, but this was about $100 million less than analysts had been expecting. Similarly, the relatively small investment management segment's revenue grew by approximately 4%, but just wasn't what Wall Street was looking for.

To be clear, I wouldn't call any of the results bad. This is still solid growth. These two segments' performance just wasn't as good as expected.

An all-around great quarter

While I wouldn't call Morgan Stanley's earnings report flawless, it would be fair to say that the bank had an excellent second quarter. So-so performance in the wealth management and investment management business was more than made up for by stellar results in trading and investment banking. Morgan Stanley has significantly underperformed the banking sector this year, but if it keeps putting out results like these, I wouldn't be surprised to see that trend reverse.