Gas prices have been at or around record highs for months now, and many have questioned the justifications from oil companies for those price hikes. Now, with second-quarter earnings reports released for all major oil companies, it seems clear that setting high prices helped oil companies score record profits.

In the wake of these massive earnings, nearly all of the companies have announced they'll be carrying out huge buybacks to boost their share prices. Collectively, Exxon (OXM  ), Chevron (CVX  ), Shell (SHEL  ), and Total Energies (TTE  ) spent $23 billion on dividends and stock buybacks in the second quarter.

Stock buybacks are "a practice that can appear unseemly, and companies don't always have the best track record of doing buybacks either," said the chief strategist at Interactive Brokers, Steve Sosnick. "Just like all other types of investors, they can be prone to buying high and not buying low."

While BP (BP  ) has been vocal about its plans to increase investment in renewable energy, in general, the oil companies "are prioritising returning cash to investors rather than investing", according to Reuter's Ron Bousso.

"I think BP's very sensitive to the reputational problems of making money at this level," the former-BP vice president and Kings College London professor, Nick Butler, told the BBC.

Exxon Mobil and Chevron, the two largest oil companies in the U.S., both reported record-high profits for Q2. Exxon came out on top globally with $17.9 billion in profits, more than three times what it made in Q2 2021. Chevron's profits also more than tripled for Q2 year-over-year, reaching $11.6 billion.

"We're going to make sure everybody knows Exxon's profits," President Joe Biden said in a speech in June. "Exxon made more money than God this year."

The two American oil giants also saw their profits from oil refining skyrocket. Chevron's profits increased from $839 million in Q2 2021 to $3.5 billion during the same time this year, and Exxon brought in $5.3 billion compared to an $865 million loss last year.

Chevron also reported that its Q2 sales increased to $65 billion from $36 billion last year, but claims that money is going towards growing "both traditional and new energy business lines", according to Chevron CEO Mike Wirth.

"Chevron is growing energy supply, increasing investment, and we're engaging constructively with Congress and this administration," Chevron CFO Pierre Breber said on an investor call.

London-based Shell reported record-breaking profits for its second quarter in a row, raking in $11.5 billion in adjusted earnings in Q2 and $9.1 billion in Q1.

"These (profit) margins are not our doing, they are the doing of how global markets play out," Shell CEO Ben van Beurden told reporters. "In the end our role is to supply the energy the world needs."

BP's earnings report showed that its net income for Q2 is nearly three times higher than this same time last year, jumping from $3.12 billion last year to $9.26 billion this Q2. The company reported its highest profits in 14 years. According to BP, the conflict in Ukraine and its impacts on supply are expected to keep prices high.

"I think there's a real case here, which I think people in the companies would be very open to, for the government calling together the industry to find a plan to get us through the winter without putting these very high prices onto ordinary consumers," Butler told the BBC.