Gregor Townsend praised the fitness and will-to-win of his Glasgow Warriors players in their in Wales on Sunday.
Warriors extended their lead when they were a man down following Gordon Reid's second-half yellow card.
"We showed a lot of character when we went down to 14 men," said the coach.
"I think we scored 10 points in that period. We really lifted our game in that second half so it's a credit to our players to come away with a win."
Rhys Patchell's four penalties had pulled Cardiff to within a point of the Scots, who had led 13-6 at half-time thanks to a Sean Lamont try.
However, it was the visitors to Cardiff Arms Park who moved clear, with Niko Matawalu scoring two tries when he came on as a substitute.
"It's very pleasing. We knew it was going to be a really tough game," Townsend told the BBC.
"Cardiff are a strong side and they are a very physical side, and for large parts of the game they had the edge in the physicality.
"We've worked really hard over pre-season and the past couple of seasons. The players' conditioning is at a high level.
"But also the bench made a huge impact, guys like Niko looking really sharp and DTH van der Merwe and that really gave us a boost."
It means last year's Pro 12 runners-up have made it two wins from two in the current campaign. Last week they beat reigning champions Leinster 22-20.
Townsend told the Glasgow Warriors website: "Cardiff seemed to get the edge on the scrums at the beginning of the second half and we made a few errors which meant there were more scrums and then we had a yellow card so it looked like the momentum was with Cardiff.
"However, I thought the way the players responded to the yellow card, took their opportunities and kept their discipline was excellent."