That and which: What's the difference?
I know the rule even though I'm not consistent in following it—and apparently most writers aren't either. The objection I hear from nongrammarians is, "I get tired of reading that all the time." My answer: So revise the sentence.
Here's the rule. That introduces an essential clause. We should play with the ball that Jack gave us. (That is, don't use just any ball, but a specific one, the one from Jack.) We sometimes call that a restrictive element because it refers to a part of the sentence we can't delete and keep the intended meaning.
Which adds information. We played with the ball, which was in the box. It's not pointing to a specific box. We set off nonessential clauses by commas, which means we could eliminate the statement. (Did you catch the use of which in the previous sentence?)
Here's a simple way to remember: If we throw out which, we don't harm or change the meaning of the sentence. I like gala apples, which I buy at Krogers. I've given you an additional detail beyond my fondness for the fruit. And I show that it's not essential by adding the comma.
By contrast, I could have written the following sentence. I like gala apples that I buy at Krogers. It means I don't like gala apples if I buy them at Publix.