Coke (KO) and Pepsi (PEP) are two "defensive" investments in an economy heading to a slowdown and perhaps an outright recession, according to some analysts.

Consumers may cut down on buying discretionary items like furniture, appliances and automobiles in such an environment, but they won't stop eating snacks and drinking soft drinks.

Both companies reported strong sales worldwide for the first quarter of 2022.

"As food and beverages are perennially in demand, price increments do not generally affect sales," Kunal Sawhney, CEO of Kalkine Group, told International Business Times. "The consumer staples earnings usually see an upswing in times of inflation. So, the first-quarter results of these global food and beverage giants are not surprising. Both have reported impressive sales with matching profits. As expected, the developing and emerging markets in Asia, Africa and Latin America were the growth engines. But Europe has also provided a generous boost."

Coke and Pepsi enjoy strong "moats," like a well-recognized brand, a state-of-the-art sales distribution network, and economies of scale and scope. According to Guru Focus, these moats allow the two companies to earn a positive economic value added of around 5%, meaning they create value for their shareholders as they grow.

That's how Coke and Pepsi keep hiking their dividend, including last quarter. Coke hiked its dividend by 4.3% while Pepsi hiked it by 5%.

Both companies saw sales growth last quarter. Coca-Cola's organic sales grew 18% while PepsiCo's sales grew 9%.

"Both the companies saw high sales growth in Africa, Middle East and South Asia region," said Sawhney.

He thinks Coke is a more promising investment than Pepsi because of its plan to boost beverage sales for refillable bottles.

"The company has been betting big on ESG goals, which may attract potential climate-conscious consumers," he said. "It can positively affect profits. The reusable packages can reduce costs and may prove critical for sales and profits in the emerging markets. Again, the promise of a low carbon footprint from reusable bottles could be a big USP. Overall, though, both the stocks seemed to be in a good position. But Coke's bet on refillable bottles would be worth watching."

Robert R. Johnson, a business professor at Creighton University, likes both companies with similar valuation metrics.

"KO sells at 24.1 times forward earnings, and PEP sells at 25.9 times forward earnings," Johnson said. "KO has a current PEG ratio of 2.93 and PEP at 3.31. In addition, the forward dividend yield of KO is 2.67% and of PEP is 2.47%."

Johnson thinks Coke may be a more promising investment than Pepsi because of the high value of its brand.

"According to the Forbes 2020 listing of the world's most valuable brands, Coca-Cola stood at No. 6 with a brand value of $64.4 billion," he noted. "Pepsi was No. 36 with a brand value of $18.2 billion."

How does Coca-Cola do it?

"Coca-Cola built this economic moat by selling not only a product, but an image," Johnson said. "The brand's strength was exemplified by the existence of a Coca-Cola store and a robust market in Coca-Cola memorabilia. Consumer willingness to pay for goods [shirts, signs, hats and other paraphernalia] that advertise the brand is evidence of just how wide the economic moat for Coca-Cola has become.

"While it may seem easy to compete in the soft drink industry, based simply on the product produced, the economic moat created by the Coke image is difficult for competitors, even Pepsi, to penetrate. So, given the economic moat created by the brand, I believe Coca-Cola to be the better investment over the long term."