Smaller children usually ages zero to three do this for purposes of experimentation, play, or boundary testing. If this behavior continues into the later years it can be a sign of a deeper mental or emotional problem.
My toddler neice ground it into her bedroom carpet once when she couldn't get her way-- and it was her way of tantruming and "getting even" with her mother. Other than that, I really have no other experience from upon which to draw.
For very young children, up to toddlers, it can be normal. For older children, or if it is a continuous pattern, it can be a sign of serious mental problems.