There is a famous book called “The Selfish Gene” which states that all our genes exist for the single purpose of reproducing themselves across generations. If this is true, then the only way genes can reproduce in sexual animals is for a male and a female to mate. So it follows that all the genes in our body work together to make sure that happens.
Most mammals achieve this by making sure mating is an instinctive behaviour – that it is “hardwired” in the brains and bodies. So one sex may automatically send out a signal (that could be by smell, or sound, or sight) when it is fertile and ready to mate. When that signal is received by the other sex it automatically responds (without any “thinking”) by trying to mate.
Now obviously its a lot more complicated in humans, as we have the free will to ignore our instincts and over-ride them with conscious thoughts. But the basic process stills exists (we still send out and receive sexual signals and our bodies respond to these).