Even after Earnshaw's 32nd minute opener, when he took advantage of a glaring error by Hornets skipper Neil Cox to net his 16th goal of the season, Watford still looked capable of causing an upset.
Hornets boss Ray Lewington felt the absence of a cutting edge cost his side at least a point.
"If you count how many times we were on the edge of the box you will find it was far more than Cardiff, but we just can't score.
"We didn't feel at all threatened in the first half as we controlled the game.
"We adopted a Kamikaze approach towards the end which is really what gifted them the third goal.
"Cardiff should be there or thereabouts at the end of the season as this is always a difficult place to come and I should think they will also add one or two players to the squad.
"Had we scored then I think the match could have been completely different."
Lewington introduced Bruce Dyer on the hour as he sensed there was at least a point available, but it was the Bluebirds who powered through for a slightly flattering scoreline.
The impressive Vidmar fired through a ruck of players in the 76th minute and then Kavanagh wrapped up the victory three minutes from time.
"It was a slightly flattering scoreline but I think we fully deserved the win," said Kavanagh.
"It wasn't perhaps the best we have played and it wasn't pretty, but the first goal settled us down and we are well pleased with another clean sheet.
"Tony Vidmar was outstanding again and his partnership with Danny Gabbidon was superb, but then all the back four had been doing well.
"Five clean sheets in seven games says it all and we will be looking for at least four if not six points from our next two matches."