With just a few months left in the year, the S&P 500 has relinquished its gains from this summer and is flirting with a negative annual finish for the first time since the end of the Great Recession. Higher interest rates, the impact of trade wars, and some notable negative corporate earnings surprises are just a few of the factors weakening market sentiment this fall.

Over the last three months, however, the consumer staples sector of the S&P 500 has advanced 6%, leading all sectors of the market. In the following segment from a show devoting to playing defense in a weak stock environment, our Motley Fool Industry Focus: Consumer Goods podcast team discusses how to invest in consumer staples through the Consumer Staples Select Sector ETF (NYSEMKT:XLP). Click below to find out how you can add stability to your portfolio as the broad averages are falling.

A full transcript follows the video.

This video was recorded on Nov. 13, 2018.

Vincent Shen: Now, let's get into the rest of our discussion. That's what role consumer and retail can play for investors in a weak market. We bring this up now, because yesterday, the S&P, DOW, and NASDAQ each declined 2-3%. All three indices are down significantly from their highs earlier this year. Volatility has been the name of the game for a few weeks now. Asit and I talked about what's driving some of this volatility two weeks ago. But that doesn't necessarily make it any easier to sift through all these headlines, these predictions that you see that the next bear market is coming, it's on its way. As this bear sentiment grows, we're seeing certain names in consumer and retail outperform. Specifically, we're talking about consumer staples and the value that they can have in your portfolio as a source of stability and diversification, especially when you're hoping to play defense without panicking and selling out of all your positions.

I remember back in Econ 101, my professor discussed certain sectors of the economy, concepts like inelasticity of demand. Asit, can you break down consumer staples for us, and the appeal that they can have in down markets?

Asit Sharma: Absolutely. Consumer staples are pretty much what they sound like. They're the staples that you buy every day that exist in your household. We're going to talk a little bit in this show about Procter & Gamble. They give you maybe the easiest way to think of consumer staples. They have everything from Tide to packaged food products that they own and that consumers buy. Consumer staples, the things that you buy before the layer of your income that we call discretionary income.

I'm going to briefly mention discretionary consumer stocks as a group, as well. We'll touch on that during the show. Discretionary income is also just what it sounds like. It's the money that you can afford to use for the things that are treating yourself in life, maybe going out to eat or buying stuff from amazon.com. Amazon is thought of as a discretionary stock.

These are the two poles of consumer stocks. I should say, these are the traditional ways to think of consumer stocks. On this show, of course, we talked a few months ago in our future episode about how the line between tech and consumer stocks is becoming vague. Some stocks which we now classify as consumer stocks might as well be tech companies. But we're going back to bedrock definitions today. I'll flip it back to you, Vince, so we can dive into the rest of the tickers that we have for folks today.

Shen: A big thing that I want to cover to start things off and to offer some perspective as to why this sector, these consumer staples, these names, this part of the economy, can be very powerful during times when things are uncertain, people are more bearish in the market. It's the performance of certain proxies. Asit, one that you turned me on to before the show the show is the Consumer Staples ETF, ticker XLP. You look at it as a proxy for this sub-sector. You only have to look at the past month to see how its trading has diverged from the broad market. Since the big sell-off in mid-October, XLP is up almost 9% while the S&P 500 is flat over the same period. That outperformance also shows through year to date in more recent months. You shared the chart with me, Asit. How did those numbers pan out?

Sharma: Let's start with the year to date numbers. This is from Fidelity. You can also find this if you go to the S&P website and look at their sector funds. Fidelity's numbers show that year to date, the healthcare sector has the largest gain. It's gained 11%. Next is consumer discretionary, which is up 8%. I'm rounding here. Information technology is next, then utilities. Information technology is up about 7%, utilities up 4%.

Everyone who's followed market understands that conditions have really deteriorated over the last three to six months. I'm going to now read you a three-month view of market sector leaders. The first is consumer staples. That's up 6% in a three-month period. Utilities are up 3.5%. Healthcare is up only 2%. Real estate is up less than 1%. Every other sector, from communication services to financials to information technology to energy, they're all negative over the last three-month period.

Shen: I'll also give you a more historical look. Take 2008 and the lead-up to the financial crisis. That was a year when the S&P 500 shed just under 40%. A huge scare for investors across the market. The XLP during that time took a hit of just 17% that year. It's not hard to see how having part of your portfolio invested in consumer staples during that time could have softened the blow from the rest of the market as things were selling off.

I took a look at the fact sheet for XLP. The top industries represented in it -- these are the things that arguably, you can't go without. That's the main theme for these industries. Think about food and beverages, household products. Tobacco is also traditionally included in this category, as well. Among the top ten holdings for XLP, you have companies like Procter & Gamble, which we mentioned, Coca-Cola, Walmart, Costco, Altria, among others. These are supposed to be the companies that remain stable even in these weaker market or economic conditions. People need what they sell regardless of those conditions.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Asit Sharma has no position in any of the stocks mentioned. Vincent Shen owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon. The Motley Fool recommends Costco Wholesale. The Motley Fool has a disclosure policy.