Hi A. - My daughter does the same thing but not so much anymore. She is a week away from turning 2. I believe I noticed her starting this between 12-15 months of age. I think for her it was experimenting with the feeling of teeth and being able to make a noise by grinding her teeth together. Now that she has plenty of teeth and has discovered other noises she make with her body (toots) the teeth grinding I guess isn't has exciting for her anymore.
I did ask a friend who is a pediatrician about this and she said the best thing to do is try to distract her.
I would tell her to stop, tell her she was giving her teeth ouwies, distract her, or offer her a pacifier.
One of these would seem to work. I hope this is helpful.
C.