Each time your thief touches a trap, its health decreases. How much health is lost depends on the level of the trap that catches it. The Health bar has three grades:

Each grade represents one star you gain for winning a level. If your health falls below a certain grade, you'll lose one star. This means less gold in the chest and a lower chance of stealing a gem from a totem. If your health falls to zero, you won't die, but the chance of obtaining a gem will be minimal. You can increase your health by crafting and upgrading thrones.