Traits are a set of three passive bonuses that can be unlocked for troops. A majority of traits have something to do with either stats/skills (such as gaining +1 attack for each Blue troop in the team), or status effects (such as being immune to Burning). Each troop has its own set of traits.
Traits can be unlocked only with traitstones, of which there are a wide variety. Traitstones can be earned from battles, chests, treasure maps, and store purchases. Each trait takes a specific combination of traitstones to unlock (increasing in total cost for rarer troops), and each troop's traits must be unlocked in sequence from the Traits tab in the Crafting Area.
Note that unlocking a trait on one troop does not unlock it for others - for instance, unlocking the Sturdy trait on Rhynax does not unlock it for the Chimera or any other troop that can have Sturdy.
Legendary traits are especially strong unique traits that are each only found on one legendary (or mythic) troop. As such they are typically a degree or two stronger than normal, but more expensive.