How Fish Reproduce
Reproduction in fishes varies widely from species to species. In every case, the fish must use an amount of metabolic energy required to reproduce (i.e., to actually spawn and look after any offspring) in the most efficient way possible.
In some cases, this means that a species will only reproduce when there is sufficient excess energy available. Other species will reproduce in direct proportion to how much energy is obtainable. Yet others will spawn regardless of what’s available and risk their own destruction in the process.
Male and female reproductive organs in bony fishes are produced in response to the genetic instructions imprinted -- in other words, male fish grow testes and females grow ovaries. Remarkably, some fish are able to swap gender if they find themselves in a single-sex environment where reproduction would otherwise be impossible.