Companies focused on the discovery, development and processing of raw materials have seen their fortunes shift this year, as tensions between the U.S. and China have ebbed and flowed amid trade talks. Given that China has historically been a huge source of demand for processed commodities, a trade war could have a significant impact on U.S. materials businesses.

Another cause for concern in the materials sector is talk of a slowdown in global growth. European economic growth is modest at best, with many countries across Europe facing their own individual problems related to economic structure. China has seen its economic growth slow down in 2018 as compared to previous years.

Still, China and other countries around the world are enacting plans to attempt to fuel economic growth. This has provided a bit of a tailwind for materials stocks at various times throughout the year. Further, despite issues in the final weeks of the year, the state of the U.S. economy was strong throughout much of 2018.

These five materials sector stocks have managed to outperform their competitors in 2018. This ranking is based on each stock's year-to-date performance against the S&P 500 index in 2018. The list is drawn from companies with market caps of at least $5 billion, all of which are listed on the S&P 500 and categorized by the Revere Business Industries Classification System as Non-Energy Materials stocks. All figures given are as of December 17, 2018.

1. Ball Corporation (BLL)

Market Cap: $16.3 billion

Performance against the S&P 500: 21.9% (BLL) vs. -5.6% (S&P 500)

2. Mosaic Company (MOS)

Market Cap: $11.9 billion

Performance against the S&P 500: 13.2% (MOS) vs. -5.6% (S&P 500)

3. Ecolab Inc. (ECL)

Market Cap: $44.7 billion

Performance against the S&P 500: 12.5% (ECL) vs. -5.6% (S&P 500)

4. Linde plc (LIN)

Market Cap: $88.5 billion

Performance against the S&P 500: 0.7% (LIN) vs. -5.6% (S&P 500)

5. CF Industries Holdings, Inc. (CF)

Market Cap: $9.7 billion

Performance against the S&P 500: -1.4% (CF) vs. -5.6% (S&P 500)

Ball Corporation

The top-performing materials stock this year was the Colorado-based Ball Corporation. Ball began operations in 1880, and for the early part of the history of the company it focused on home canning products, including glass jars and lids. From those humble beginnings, Ball has diversified its operations to include aerosol cans, bottles and even aerospace products.

Why Ball outpaced its competitors in the materials sector in 2018? A couple reasons. First, Ball reported outstanding third-quarter 2018 adjusted earnings at 56 cents per share, an increase of 7.7% year over year. These earnings were achieved as a result of strong performance across the company's business lines, as well as lower corporate costs than expected. The company predicted free cash flow of about $800 million for 2018 and earnings per share to climb by as much as 15% in 2019. Notably, Ball launched new manufacturing operations during the third quarter in new locations across the globe. All of these factors combined to drive the BLL stock price up.

Mosaic Company

Phosphate and potash mining operation Mosaic Company was the second-best performer in the materials sector in 2018. As the largest producer of phosphate- and potash-based fertilizers in the U.S., Mosaic has long held a reputation as a major player in the materials space.

Per an SEC filing, more than 81% of all Mosaic shares are held by institutions, with a total of 815 institutional investors taking part. The company has drawn investor attention for its progress on the development of the Esterhazy K3 mill, which is expected to lift up to 10 million tons of potash each year.

Ecolab Inc.

Minnesota-based Ecolab Inc. produces water and hygiene technologies and services for a variety of markets. The company also provides chemicals to beef and poultry processors aimed at reducing pathogens in uncooked meats.

Some of the reasons why Ecolab outperformed most of its competitors in the materials space in 2018 include an impressive 12% increase in quarterly cash dividend heading into January of 2019. This marked the company's 27th consecutive annual dividend increase. The popular stock announced plans to acquire cleaning solutions company Holchem and made offers to buy up other companies as well. Early in the year Ecolab was named one of the world's most ethical companies for the 12th consecutive year by the Ethisphere Institute.

Linde plc

After DowDuPont, Linde plc is the second-largest materials company considered for ranking on this year's top 5 list. The Irish-domiciled chemical company was formed when U.S.-based Praxair merged with Linde AG, a German company, in 2016. Now, Linde plc is the largest industrial gas company in the world by metrics like revenue and market share.

In a tough year for materials stocks, Linde managed to end 2018 relatively flat. Indeed, Linde has not had much time to be tested in its current form: the company was formed only in October of this year, when the merger was complete. Already, though, Linde leaders have announced a share repurchase program in which the company may buy up to $1 billion worth of ordinary shares through the end of April, 2019.

CF Industries Holdings, Inc.

Rounding out the top 5 materials sector stocks for 2018 is Illinois-based CF Industries Holdings, Inc. CF Industries is a maker and distributor of agricultural fertilizers.

Like Mosaic above, CF saw a boost whenever fears about the impact of a potential U.S.-China trade war on U.S. agricultural production diminished. The company has recently made a name for itself as a production leader in the nitrogen/urea market. This has come along with efforts to increase production efficiency, as well as development of new nitrogen plants. However, later in the year, CF's new focus on nitrogen may have worked against the company: in November, Indian urea prices shocked the market by falling short of expectations, creating a blemish in CF's performance for the year.