In general, once exposed to certain environmental cues, epigenetic changes cause developing individuals to become either male or female.
Generally speaking, epigenetic modifications triggered by environmental cues decide the sex of a developing individual.