I am aware of this and I was monitoring the behavior when she started approaching that part of the backyard. The goat is somewhat pretty smart because it does not touch the leaves at all. Just the fruits.
Goats are ruminants.
> Ruminants [...] are able to acquire nutrients from plant-based food by fermenting it in a specialized stomach prior to digestion [...] The word "ruminant" comes from the Latin ruminare, which means "to chew over again".
https://en.m.wikipedia.org/wiki/Ruminant
TIL: So that's from where the word "ruminate" comes :-)
The latter are toxic to (AIUI) all monogastrics, same as potatoes and other Solanum family plants - you may want to reign that behaviour in, assuming the animals are still alive.