Hermi can result from stress. Plant stress comes from abiotic factors, like drought, temperature extremes, and high salt levels, and biotic factors, including pathogens (fungi, bacteria), insects, and herbivores. Other forms of stress can stem from improper care, such as over/underwatering or poor fertilization, or even mechanical damage.
Stress = JA + ABA. Jasmonic acid combines with Asbisic acid.
Plant stress causes hermaphroditism as a survival mechanism; under adverse conditions, a genetically female plant develops male reproductive organs (pollen sacs) to self-pollinate and ensure seed production for the continuation of the species when the chances of cross-pollination are low. Common stressors include environmental factors like light leaks, drastic temperature changes, nutrient imbalances, and physical damage, which activate this "emergency switch" within the plant's genetic makeup.
Some have high tolerance to stress, some do not.