Thanks for using Petco Pet Education Center, formerly Petcoach. Teeth grinding is often a sign of nausea, mouth pain, or anxiety. If the first, you might also see drooling, changes in eating habits, or eating grass. If the second, you may also see teeth chattering, dropping food, etc. If it is anxiety related, you may notice patterns such as always after travel or when the other dog is near, etc.
If it is only happening occasionally, I usually don't panic. If it's becoming more frequent, it's time to see the vet.