McDavid's first goal made him the eighth player in NHL history to score 400 points before turning 23, and his third gave him his fifth NHL hat trick.
Leon Draisaitl matched his NHL career high with four assists, extending his point streak to nine games (eight goals, 10 assists), Ryan Nugent-Hopkins scored two goals, and Zack Kassian had a goal and two assists for the Oilers (12-5-2), who have won two games in a row. Mikko Koskinen made 31 saves.
"I liked our game. I liked the result all over," McDavid said. "Good effort from everyone."
WATCH: [All Oilers vs. Ducks highlights]
Rickard Rakell scored in his 400th NHL game, and John Gibson made 25 saves for the Ducks (9-8-1), who have lost their past three games (0-2-1).
"We got outplayed," Anaheim captain Ryan Getzlaf said. "We said they were an opportunistic team. They were. We said they were good on the power play. They were. We got outplayed."
The Oilers took a 1-0 lead in the first three minutes for the third time in their past four games.
After James Neal forced defenseman Korbinian Holzer into a turnover behind the Ducks net, Nugent-Hopkins retrieved the puck and scored unassisted inside the right post from along the goal line at 1:28.
"He's always been deadly out there," Kassian said of Nugent-Hopkins. "If he's not scoring, he's playing the right way."