Final answer:
Hermaphroditism can arise in a species when there is high mate fidelity or when the cost of reproduction is high.
Step-by-step explanation:
Hermaphroditism can arise in a species when there is high mate fidelity, meaning that individuals are faithful to one mating partner. In this scenario, individuals with both male and female sexual functions may be advantageous because they can reproduce with any available mate. Additionally, when the cost of reproduction is high, hermaphroditism can be beneficial as it allows individuals to conserve resources and reproduce only under optimal conditions.