The stock market has posted amazing gains since March, but when you look past the major indexes to see what's happening, you get a much different picture. There's been a tug of war between young tech companies and old-economy stocks, and for the most part, the upstarts have stolen the show in 2020. However, that wasn't the case on Tuesday, as the old-timers fought back. As of 12:18 p.m. EDT, the Dow Jones Industrial Average (^DJI -0.11%) was up 273 points to 26,954. The S&P 500 (^GSPC 0.02%) rose 13 points to 3,265, but the Nasdaq Composite (^IXIC 0.10%) was down 61 points to 10,707.

The energy sector played a key role in lifting the Dow today, as both of its oil company components posted significant gains. Yet many other players in the oil patch did even better. Below, we'll look more closely at what's happened in the energy markets and what impact it's having on stocks more broadly.

Several oil wells pumping, with a sunset sky behind.

Image source: Getty Images.

Why oil is getting more popular

The fortunes of many companies in the energy sector are closely connected to the price of oil. During the COVID-19 pandemic, oil prices have been extremely volatile, and they've remained depressed for a long time. The brief period in April when oil futures went negative showed the extent of short-term imbalances between supply and demand.

Since then, though, oil prices have bounced back dramatically. On Tuesday, West Texas Intermediate crude picked up more than 3%, rising above the $42-per-barrel level. That's still not high enough to make it easy for even the largest, most efficient energy companies to make money. However, it offers hope that a stronger economic recovery could send prices even higher, and then many companies that are struggling to survive could finally start to return to profitability.

In general, the more concerned investors have been about a particular company lately, the more its share price has risen Tuesday. Occidental Petroleum (OXY -0.09%) shares were up 13%, while SM Energy (SM 0.40%) jumped 14%. Further up the spectrum, Chevron (CVX 0.44%) picked up 6% to contribute to the Dow's gains, and BP (BP 0.13%) matched that 6% rise.

The good news also spread to related subsectors within energy. Oil-field services companies Halliburton (HAL 0.34%) and Schlumberger (SLB -0.89%) were up 10% and 7%, respectively. Refiners Valero Energy (VLO -0.32%) and Phillips 66 (PSX -0.66%) both rose 5%.

Are more mergers coming?

Also lifting spirits among energy investors was Monday's announcement that Chevron would purchase Noble Energy (NBL) in a $13 billion merger. The all-stock deal will involve Noble Energy investors receiving Chevron stock worth about $5 billion, and Chevron will assume roughly $8 billion in Noble Energy debt.

Strategically, the acquisition will boost the combined company's asset base in key areas like the Permian Basin. It will also give Chevron greater exposure to areas like the Eagle Ford shale play and the DJ Basin, as well as international assets off the coast of Israel and west central Africa. Combining efforts should produce substantial cost savings -- something that's extremely important with oil prices remaining below historical averages.

Those following energy stocks hope that the Chevron deal will be just the beginning of a new phase of consolidation within the industry. Even with oil prices having climbed recently, there remains a lot of uncertainty about the future course of the broader economy and its potential impact on demand for energy products. Until the COVID-19 pandemic comes to a clearer resolution, it will still be smart for oil companies to look at ways to join forces and save money.