Every time your thief touches a trap, it will lose health. The amount of health 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 a 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 your chance of getting a gem will be minimal. You can increase your health by crafting and upgrading thrones.