Nothing separated the teams at the break, JJ Hanrahan and Rhys Patchell exchanging three penalties each to leave it well poised at 9-9.
The hosts pulled away in the second-half, converted tries from captain Denis Hurley and back-rower Jack O'Donoghue putting clear daylight between the sides.
Cardiff struck back with a try of their own through flanker Josh Navidi, Patchell converting, but Ronan O'Mahony's late converted score sealed the win that takes the hosts to the top of the GUINNESS PRO12 table.
And Hammett had no complaints after the game, conceding that his side were lucky to remain competitive in the game for as long as they did.
"I thought Munster played how we'd have like to have played," he said. "Credit to them they deserved the win.
"Even at half time I didn't think we quite had the energy around the contact area and around how hard we carried the ball."
Follow us on Facebook, join the conversation on Twitter, sign up to ourYouTube channel for extensive match highlights and sign up for our newsletterfor regular updates on the GUINNESS PRO12
Guinness PRO12
Suite 208, Alexandra House,
The Sweepstakes
Ballsbridge, Dublin 4, Ireland