HOUSTON—Chevron Corp on Friday posted its highest quarterly profit in eight years on surging oil and gas prices, higher output, and a recovery in motor fuel demand that boosted refining margins. The strong results for the No. 2 U.S. oil producer came a day after U.S. lawmakers grilled top executives of major oil companies over the industry’s past dismissals of climate warming and for funding groups that oppose a shift from fossil fuels. Chevron’s earnings reflect, in part, gains from higher demand after the industry’s deep production cuts last year during the pandemic and production increases. The company posted net income of $6.11 billion, compared with a loss of $207 million a year ago, on sales of oil that fetched nearly twice as much as a year ago and U.S.-produced gas that sold for three times as much. Shares rose 1.2 percent to $114.49 on Friday and have gained more …