One of the thirty-nine Melachot (categories of activity) that are forbidden on Shabbat is "Zore’a" (literally, "planting"), which includes any action which promotes the growth of vegetation. Thus, Torah law forbids watering one’s lawn on Shabbat, as the water promotes the growth of the grass. In fact, the Shulhan Aruch (Orah Haim 336) writes that if one eats outdoors on Shabbat, he may not wash Netilat Yadayim over grass. Even though Netilat Yadayim fulfills a Misva, washing over grass is forbidden due to the prohibition against watering vegetation on Shabbat. What’s more, the Rama (Rav Moshe Isserles of Cracow, 1530-1572) writes (listen to audio recording for precise citation) that it is preferable not to eat on a lawn or in a garden on Shabbat if water is being used, due to the likelihood that some water will spill onto the ground.
The Shulhan Aruch addresses in this context a case which was very common in earlier generations, before the advent of modern plumbing – urinating on lawns or fields. Would relieving oneself on vegetation be akin to watering, such that it should be forbidden on Shabbat?
The Shulhan Aruch writes (336:3) that this is permissible, and the Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933) explains that the pungency of urine makes it detrimental, not beneficial, to the vegetation, such that it does not violate the prohibition of "Zore’a." As mentioned, watering vegetation is forbidden on Shabbat because it promotes the vegetation’s growth, and therefore, the Mishna Berura explains, this prohibition does not apply to urine, which, if anything, hinders the growth of the vegetation.
The Bi’ur Halacha (essays by the author of Mishna Berura) cites the Tiferet Yisrael who noted the claims of modern scientists that to the contrary, urine fertilizes the ground and is beneficial to the growth of vegetation, such that urinating on a lawn should be forbidden on Shabbat. However, the Bi’ur Halacha notes the widespread practice to permit relieving oneself on the ground on Shabbat, and rules accordingly. This is the position accepted by Hacham Ovadia Yosef, both in Leviyat Hen (102) and Halichot Olam (vol. 4, p. 289). Citing the Terumat Ha’deshen (271), Hacham Ovadia writes that we should not rely on modern scientific findings to rule against the Halachot established by the Talmud, even to rule more stringently. Therefore, once Halacha has established the permissibility of urinating on vegetation on Shabbat, this remains permissible even in the face of scientific revelations concerning the beneficial effects of urine in promoting the growth of vegetation.
Nevertheless, Hacham Ovadia writes that it is preferable, when possible, not to relieve oneself directly onto the lawn, but off to the side, even if the urine then flows onto the grass.
Summary: It is forbidden to water a lawn or any vegetation on Shabbat, and thus when eating outdoors on Shabbat, special care must be taken to avoid spilling liquid on the lawn or garden. It is, however, permissible to urinate on grass on Shabbat, though when possible, it is preferable not to do so directly, but to relieve oneself next to the lawn even if the urine then flows onto the lawn.