Deer do not eat all plants. There are a few that are toxic to them. There are more that deer simply dislike. With a minimal bit of research, it is not difficult to find a few lists of plant species that deer are supposed to avoid. The problem with such lists though, is that deer do not read them. Only toxic plants are reliably safe from deer.
It would not be so bad if only deer were a bit more cooperative. They would be welcome in gardens if they ate only weeds that no one wants anyway. We all know that they can eat weeds, they just choose not to do so while they are in our gardens.
For that matter, gophers would not be such a problem if they ate only weeds, and aerated only soil that needs it. Instead, they seem to target the most important plants they can find, and excavate primarily in lawns. There is no effort to cooperate.
For as long as people have been growing vegetation, whether as agricultural commodities or in landscapes, people have been competing with wildlife of one form or another, or several others. Wildlife is no more cooperative now than it was many thousands of years ago. Some animals are even less cooperative than their ancestors were. Some are downright defiant!
Gophers have been known to push traps out from their tunnels, without springing the traps. Some will emerge from their subterranean tunnels to step over the tops of root cages that are designed to exclude them, just to get to the roots within. The gopher associated with the excavation seen in the picture above was not so defiant, but was certainly undeterred.
The foliage at the center of the picture is gopher purge. Although not planted here intentionally, it used to be planted around vegetable gardens to deter gophers. It has a caustic sap that is very irritating to gophers if they try to excavate through the roots. However, the picture clearly shows excavation to the left, to the right, and behind the gopher purge.