Jane Austen's novels often feature contrasting characters, as a literary foil to highlight or showcase particular qualities of another character. Pride and Prejudice has several good examples of literary foils:
Mr. Darcy vs. Mr. Collins
Both are potential suitors to Elizabeth's hand, and both make the mistake of a terrible marriage proposal; Austen uses the odious Mr. Collins show the reality of what many women like Charlotte Lucas had to consider: a loveless marriage in exchange for security and comfort. When held up next to each other, Mr. Darcy's positive attributes outshine Mr. Collins; both were possible choices for Elizabeth to marry, but in the end, she shows wisdom in waiting for a man she could truly respect and love.
Lydia Bennett and Elizabeth Bennett
Lydia makes Elizabeth look good in the story; to be honest, Lydia could be the poster child for bad decisions and behavior in Regency England. She has none of Elizabeth's finer qualities, and her outrageous behavior sharply contrasts Elizabeth's good sense. Lydia is without a doubt, one of the "silliest girls in England" as her father described her, but it is really her decision to elope with Wickham that Austen uses to drive home a hard point about marriage and family. Lydia's selfish decision to elope brings shame to the family, but Elizabeth's outstanding marriage to Darcy honors the family.