Source · the work in full
Ibn Ezra on the Torah
Chapter 2
Genesis 2
This belongs to the [passive] verb form in which the subject is not mentioned, as in "all the mountains were covered." The meaning here is "they were completed." The ocean is included in "the land" specified in this verse, as they are one unit.
The meaning of "to work it"is to provide water for the garden. "To guard it" from animals and to ensure that they do not enter the garden and sully it. Some explain that "to work it" means "to fulfill the command [no to eat from the tree], but this cannot be correct because a 'command' is not called 'work'.
You arrive at the cited line; the whole work is yours to read around it. The text is set from the cited public-domain edition.