The champions have struggled to recapture the form that carried them to a fairytale title last season but were back to their imperious best at times during the match at King Power Stadium, where the hosts were 2-0 up after just five minutes.
Vardy scored a hat-trick, with Mahrez playing a role in his opener and supplying the assist for the England striker's second, an impact that saw the pair earn the appreciation of their Italian manager.
"The big champions react at the right moment," Ranieri told BT Sport.
"When they [Mahrez and Vardy] play well, often we win. Today they made a fantastic performance, a fantastic effort for the team. That's what I love. We aren't a big team, but we can do something good when we play together.
"We prepared so well for the match, we know all the triangles they [Manchester City] try to do to [get into] the last third. We closed [them down] very well. Of course, at the end we were a little tired and they scored twice, but the performance was good."
Ranieri highlighted forthcoming fixtures against Bournemouth and Stoke City as crucial, with the Foxes, languishing in 14th place, seeking to climb away from the wrong end of the table.
"The next matches until Christmas are very important," he said.
"Because we are in a battle against relegation. And I said 'in the battle, I need warriors.' And they showed me what I wanted to see.
"They said 'we believe in ourselves and this system'. If I started with another system, they don't recognise our style.
"They understood my philosophy. And I hope now we can go back to the same level as last season. You can't win all the matches. But you can fight. This is my philosophy.
"Last season, everything was perfect. Not always can you do perfect. But you [can] work so hard to defend your title."