At a rain-sodden King Power Stadium, Vardy hit his first top-flight treble and Andy King also found the net to ensure Leicester atoned for their 5-0 Champions League mauling by Porto.
"We wanted to make sure we were competitive today and see the team fighting for the cause and we have done that," Vardy, whose side climbed to 14th place, told BT Sport.
City, who replied through Aleksandar Kolarov and Nolito, had previously fallen to a stormy 3-1 loss at home to Chelsea and lie four points below new leaders Arsenal, who beat Stoke City 3-1.
Nolito's late goal spared Guardiola from his joint-heaviest league defeat as a manager, but the game exposed huge flaws in a defence that has registered just one clean sheet in 17 matches.
"Long balls, second balls, they won the second balls and scored fantastic goals," Guardiola told the BBC.
"Football is a game with mistakes, especially today. Our game is not bad, but in the box we have a lot of problems."
With Sergio Aguero and Fernandinho banned after being sent off against Chelsea, Guardiola had to reshape his team, with Kelechi Iheanacho and Fernando selected to deputise.
But his plans fell apart in less than five minutes as quick-fire goals by Vardy and King put the champions in charge.
With less than three minutes on the clock, Riyad Mahrez's pass was helped on by Islami Slimani for Vardy, who drilled home his first Leicester goal since September 10.
Two minutes and 15 seconds later, City failed to clear a long throw-in and Slimani teed up King to arc a fine shot into the top-left corner.
After Slimani had volleyed over, Leicester added a third, Mahrez's exquisite cushioned pass releasing Vardy to round Claudio Bravo and roll in his second.
City, who remain fourth, bossed the second half, but Vardy completed his hat-trick in the 78th minute after seizing on a wretched John Stones back-pass, rendering Kolarov's free-kick and Nolito's goal anecdotal.
Leicester manager Claudio Ranieri said he had seen "the true Leicester".
"I said I need warriors and they showed me what I wanted to see," he added.
Ozil inspires Arsenal
The match completed a day that featured 29 goals in six games, with all six home teams scoring at least three goals.
Mesut Ozil's crafty header inspired Arsenal to a comeback victory over Stoke as Arsene Wenger's side supplanted Chelsea at the summit.
Charlie Adam's penalty put Stoke ahead at the Emirates Stadium, but Theo Walcott equalised before Alex Oxlade-Chamberlain teed up Ozil to float a delightful header over Lee Grant in the 49th minute.
Alex Iwobi completed the victory to lift Arsenal top on goals scored above Chelsea, who go in search of a ninth consecutive win against West Bromwich Albion on Sunday.
Victory came at the cost of a first-half injury to Shkodran Mustafi and Wenger was aggrieved that Stoke were awarded a penalty after Granit Xhaka caught Joe Allen with his elbow.
"We got a very unlucky penalty against us, because it is not even a foul in my opinion. But we have showed great mental strength," said the Arsenal manager.
"It is down to us to maintain the focus and the desire to improve. We have a chance to fight at the top."
Italian striker Stefano Okaka scored his first Watford goals as Walter Mazzarri's side came from behind to beat Everton 3-2, leaving Ronald Koeman's men with one win from 10 league games.
Romelu Lukaku netted twice for Everton but Okaka's double -- the first a brilliant, volleyed flick -- and a Sebastian Proedl header earned the hosts victory.
Swansea City climbed off the bottom at Sunderland's expense with a 3-0 home win over the north-east club in which Fernando Llorente scored twice.
Wilfried Zaha starred as Crystal Palace rescued a point in a topsy-turvy 3-3 draw at fellow strugglers Hull City.
The former Manchester United winger won a penalty, scored a sizzling solo goal and set up Fraizer Campbell to head in Palace's 89th-minute equaliser.
Meanwhile, Jeff Hendrick's brilliant flick-and-hit volley set Burnley up for a 3-2 home win over Bournemouth.