What is a Foil in Literature?

A foil is a character who defines the hero by being their complete opposite. The name comes from jewelers, who would put dull foil under the brilliant jewels to create a better contrast. In A Tale of Two Cities, Darnay appears braver when compared to this cowardly Sydney Carton.