Gonzalo Higuain and Kaka both netted braces but it was Ronaldo who caused all the damage with arguably his best display of the season to help Madrid bounce back from their poor showing in Lyon and trim the gap to Primera Division leaders Barcelona back to two points.
Ronaldo scored a brilliant free-kick opener, which he dedicated to the victims of the disaster that has struck his home island of Madeira, and also created goals for Higuain, Kaka and Xabi Alonso as Madrid made it 12 wins out of 12 at the Bernabeu this season.
Marcos Senna and Nilmar pulled goals back for Villarreal but they could not live with Madrid, whose coach Pellegrini will have been especially pleased with the win over his former club as his position has been called into question in the wake of the Lyon defeat.
"I am fully satisfied and happy with the work of the team. The numbers are important and I am very pleased with the work we are doing," Pellegrini said afterwards.
"I'm very happy because the defeat to Lyon emotionally affects a team that had a good level. Today was important to get strong emotionally and keep close to Barcelona.
"It was very balanced. Villarreal are a good team and if there is anything that I liked from them it was the second goal. I liked the aggressiveness of the team. If you let them Villarreal can play, could do harm. They have a good team, offensively and defensively."