That is restrictive, it limits / restricts / specifies the identity of the subject. Using your example, the bear that scratches his head refers to one specific bear -- "the bear that scratches his head".
Which is non-restrictive, meaning it refers to something incidental about the subject. "Consider the bear, which scratches its head" refers to the bear (could be a single bear, could be the species), which happens to scratch its head.
Hope that helps!
EDIT: ShreevatsaR has pointed out that this is a convention, not a grammar rule. In the end it doesn't "matter", use the convention if it appeals to you. Here is MW's take (thanks, nohat).