One of the thirty-nine Melachot (categories of forbidden activity) that apply on Shabbat is "Koser," or harvesting. The Talmud speaks also of a subcategory of this Melacha called "Tolesh" ("detaching"). The Lehem Mishneh (commentary to the Rambam’s Mishneh Torah by Rav Avraham De Boton, 16th century) explains that Koser refers to detaching vegetation from the ground with a tool, such as a sickle, whereas Tolesh refers to detaching something with one’s hand. Both are forbidden on Shabbat on the level of Torah prohibition.
The classic case of this prohibition is removing produce from a tree or from the ground. This would include cutting wheat from the ground, or removing fruits from trees, such as grapes, figs and olives. In all these cases, whether one uses a tool or his hand, he violates the Shabbat prohibition of Koser.
The Shulhan Aruch (Orah Haim 336:5; listen to audio recording for precise citation), based on the Gemara (Shabbat 107), rules that the Torah prohibition of Koser applies not only to detaching vegetation from the ground, but also to detaching something from the place where it grows and is nourished. Examples would include detaching grass or moss that grows on rocks or on the walls of buildings, or taking mushrooms and other funguses that grow on the ground but aren’t nourished from the ground. In these cases, one violates the Shabbat prohibition of Koser, since he detaches something from the place where it grows, despite the fact that it does not grow from underneath the ground or from a tree.