When one becomes ungrounded, a mineral deficiency is the primary cause. Vegetarians, vegans and raw-foodists who become ungrounded typically are eating weak, mineral deficient food. Animal foods - especially fish - due concentration of minerals, tends to bring people back to earth who have become ungrounded. There are other ways to ground oneself with plant foods.
Grounding occurs due to increasing the mineral-content of foods in one's diet. The more minerals in the food, the more grounded you feel the more minerals, the more "ground" – literally.
Generally, organically-grown, fatty foods (specially nuts and seeds) and green leaves are good sources of minerals. So, to ground the body, one would balance there and avoid commonly-found, mineral-deficient fruit.
Superfoods and seaweeds play an important role with keeping individuals grounded as well. Superfoods and seaweeds are generally dramatically more mineral- and protein-rich than everyday organic produce.
Edible clays and see or rock salts, because they are earth, are also grounding.