The term you want to search for is "phytoestrogens".
From wikipedia: "It has been hypothesized that plants use a phytoestrogen as part of their natural defence against the overpopulation of herbivore animals by controlling female fertility.[3][4]"
Though wikipedia also says: "These compounds in plants are an important part of their defense system, mainly against fungi.[19]"
So it could be that plants are principally targeting fungi for the most part, and just serendipitously targeting animals as well.
From wikipedia: "It has been hypothesized that plants use a phytoestrogen as part of their natural defence against the overpopulation of herbivore animals by controlling female fertility.[3][4]"
Though wikipedia also says: "These compounds in plants are an important part of their defense system, mainly against fungi.[19]"
So it could be that plants are principally targeting fungi for the most part, and just serendipitously targeting animals as well.