Caterpillar (NYSE:CAT) shares were left high and dry by last year's mega bull market, gaining a piddling 3.3%, far below the broader S&P 500 26.5% gain. But Caterpillar was not the only mining-related stock that sat at the sidelines while most stocks soared. Peers Deere (NYSE:DE), Terex (NYSE:TEX), Cummins (NYSE:CMI), Manitowoc (NYSE:MTW), and Joy Global performed far worse, with all four suffering declines of 7.7%, 0.4%, 0.3%,2% and 4.5%, respectively.

In a pleasant twist, Caterpillar has seen better fortunes this year, and its shares have ramped up 11%, more than they did for the whole of 2013. Its four peers have also seen considerable gains so far. There is reason to believe that these mining equipment makers will continue to perform well for the rest of the year.

Earnings beat
Caterpillar stock rallied 4% on Jan.27, 2014, after it topped quarterly earnings estimates. Its fourth-quarter profit of $1.58 per share was $0.30 better than the consensus estimates. Its operating margins for its various segments expanded, while cost-cutting and strong sales for its construction equipment helped it garner an overall revenue of $14.4 billion, better than the consensus estimate.

After the earnings call rally, shares had gained a further 7.6% in just five days, indicating that investors were optimistic about the company's revenue growth prospects for this year. Cat's mining, engines, and construction equipment are all showing promise, and 2014 looks like it will be a year of stabilization in sales after the company recorded a 40% drop in revenue last year. Its earnings peaked at $8.90 per share in 2012, when mining capital expenditure grew at a blistering pace driven by ultra-high gold and precious metal prices.

In 2013, Caterpillar ratcheted down earnings guidance due to concerns of slowing growth in China. It announced that it expects earnings to come in at $5.85 in fiscal 2014, marginally higher than last year's earnings, and also announced a $10 billion stock buyback program.

Non-residential construction recovery
Analysts expect a recovery in the non-residential, or non-resi, construction sector in Caterpillar's U.S. market, which is also its biggest. Cat is expected to see better sales of construction equipment, driven by non-resi construction recovery, and a likely improvement in commercial building.

Although Caterpillars customers are cutting inventory levels, the rate of slowdown is well below replacement levels, which bodes well for the company's future sales. Meanwhile, cost-cutting is helping to offset the lower sales, particularly that of high-margin mining equipment.

The non-resi construction sector has been undergoing a gradual recovery. The sector recorded mixed results in 2013, with manufacturing facilities, offices, education facilities, and amusement and recreation centers declining 7.4%, 4.7%, 3.4% and 3.9%, respectively in the first half of 2013. Spending in lodging facilities, however, grew rapidly at 20%. Non-resi growth is expected to come in at 5% this year. This should help stocks such Caterpillar, Terex, and Manitowoc.

Pure-play construction machinery manufacturer Manitowoc, which manufactures cranes, stands to benefit the most from this positive trend. Crane sales are projected to grow 10% in 2014. The firm's shares have risen about 5% year to date.

The agricultural machinery sector, however, is not expected to be so rosy. John Deere has a huge exposure to the agricultural machinery sector. The continued poor performance for the sector has led Deere to forecast that its topline will fall from $3.54 in 2013 to 3.3 billion in the current quarter in the current year. This will be the first time the company will be recording a sales decline in five years.

Strong growth in the construction and forestry equipment sectors, however, helped Deere reaffirm its earlier revenue guidance, which was significantly higher than the consensus estimate of $3.13 billion. Investors are likely to react positively to the good news. Its shares are also very cheap, trading at a forward P/E ratio of just nine, and should see some gains this year.

Improving sales in emerging markets
Despite the huge 11% gain year to date, Caterpillars shares still look reasonably priced trading at a 16.9 forward P/E ratio, and should see further gains buoyed by the strong Chinese market, where revenue shot up 20% in 2013 to about $3.5 billion. Caterpillar revealed that it is seeing strong growth in demand for excavators in the Chinese market.

Caterpillar derives 25% of its revenue in the Asia Pacific region, and another 14% from Latin America. Many countries located in these markets are showing strong growth, with the exception of Argentina and Turkey, which have continued to lag, so the overall outlook for emerging markets is good.

Strong aftermarket business
Caterpillar relies on the aftermarket business for 25% of its revenue. In this golden age of service, pushing products must be complemented by providing valuable after-sale services to customers. The aftermarket helps manufacturing company mitigate the effects of sluggish demand, intensified competition and imploding profit margins.

Mining capex recorded robust growth during a 12-year spending spree during which it shot up an astounding 600% to hit a record $100 billion in 2012. Since then, it has been steadily declining on a cyclical downturn, falling 24% in 2013. Caterpillar saw huge declines for both its top and bottom lines in fiscal 2013, of 17% and 44%, respectively. The huge slide was precipitated by an equally large 33% fall in sales in the company's mining segment.

The long-term trend is decidedly toward more capital spending due to factors such as technical challenges that accompany extraction, scarcity of key minerals, increased mining activity in East Africa, and heightened environmental security. The decline in mining capex is expected to tick in at 55% and bottom out in 2016 or 2017. During the hiatus before the good times return, the aftermarket will take care of all that machinery that was purchased during the 12-year buying spell.

Final thoughts
Although mining capex is expected to continue to fall in 2014, albeit at a slower rate than it did last year, Caterpillar shares should see some more gains driven by growth in the Chinese market, more construction in the non-resi sector, and a robust aftermarket business. Investors should also not worry too much about Cat's restructuring charges because they are already baked into the shares.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.