In principle, my understanding of how that might work is as follows:
Most plants have innate defenses against predation.
Typically, these defenses are chemical in nature, but universally, they require
energy to implement.
A high sugar content means plants have the luxury of implementing pest control measures that might otherwise be economized on, in favor of more essential functions.
One example is methyl salicylate, which can serve as a signal to attract predatory insects to plants infested with. It takes some energy to synthesize enough that far-away insects can smell it, and I think it has to be synthesized in advance, ready for release when the nibbling begins, in order to really be effective. A struggling plant might not invest in such a defense mechanism, but if there's a lot of sugar available, some will go toward that sort of nicety.
"the qualities of these bacteria, like the heat of the sun, electricity, or the qualities of metals, are part of the storehouse of knowledge of all men. They are manifestations of the laws of nature, free to all men and reserved exclusively to none." SCOTUS, Funk Bros. Seed Co. v. Kale Inoculant Co.