With the stock market having set new highs all year, it was only reasonable for traders to expect that May would finally provide a long-awaited reversal in the four-year-old bull market. Yet once again, the market defied those expectations, and even with an ugly day yesterday, the Dow Jones Industrials (DJINDICES:^DJI) closed out May with a gain of nearly 2% for the month.

When you look more closely at the Dow's month, you'll find that the rally was fairly broad-based, with 20 of the average's 30 components posting gains. Four of those stocks picked up 11% or more on the month. Let's look at those companies to see what we can glean from their strong performances.

Hewlett-Packard (NYSE:HPQ), up 18.5%
Most of HP's gains came in the wake of its earnings report last week, in which the stock gained 17%. Although investors expected to see concrete signs of progress in HP's turnaround, they didn't expect to see the resiliency that the company's results exhibited. Earnings and net income predictably fell because of weakness in the PC market, but promising prospects in areas like networking, cloud services, and software have investors believing that the company is moving more quickly toward recovering profit growth than they previously thought. HP still has a long way to go, but arguably, regaining the confidence of shareholders was the key obstacle for the company to overcome.

Cisco Systems (NASDAQ:CSCO), up 15.3%
As with HP, Cisco scored most of its share-price advance in a single day, gaining 12% after it beat earnings estimates. With several competitors already having made their quarterly reports and showing severe signs of sluggishness in the industry, most investors expected Cisco to follow suit. Yet substantial gains in gross margins and positive guidance for the current year convinced investors that the networking giant still has the power to exercise its industry-leading muscle as a competitive advantage. The IT industry remains difficult, with persistent fears that IT spending will fall this year. So far, though, Cisco doesn't seem to be falling prey to those fears.

JPMorgan Chase (NYSE:JPM), up 11.4%, and Bank of America (NYSE:BAC), up 11%
Both of these big banks rose sharply for some shared reasons, despite having individual issues affecting each of them separately. For JPMorgan, the biggest news of the month was the shareholder vote that allowed Jamie Dimon to retain his dual role at the bank as chairman and CEO, the result of which investors cheered with solid price gains surrounding the vote. Meanwhile, B of A posted its largest jump after saying it had settled its lawsuit with mortgage-insurer MBIA, a case that had many investors worried about potential liability. But the bigger push higher for both banks could come from the recent increase in long-term interest rates, which could boost net interest income and thereby make B of A and JPMorgan even more profitable than they have been lately. If rates keep rising at the long end of the yield curve despite the Federal Reserve's clamping down on short-term rates, watch for further gains.

Sell in June?
Given Friday's more than 200-point drop in the Dow, it might be tempting to take profits and get out of the market for a while. But people who've said similar things at various points throughout the past four years have been sorely disappointed. By looking for stocks like these that can outperform the Dow, you won't have to rely solely on gains in the overall market to produce your investment returns.

Fool contributor Dan Caplinger owns warrants on JPMorgan Chase and Bank of America. You can follow him on Twitter: @DanCaplinger. The Motley Fool recommends Cisco Systems and owns shares of Bank of America and JPMorgan Chase. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.