Basically they both select each other. Like most animals, the male will choose the fittest female and begin courtship, then it's up to the female to determine whether the male is good enough to pass on his genes to the next generation.
If your male killed the female it might be because he didn't think she was good enough, or because she wasn't ready to breed. Remember that Cichlids don't just kill their own for the sake of it, they are trying drive each other away. In a glass box, this harassment results in death. The way I see it is that once the male realizes the female is not good for breeding, she's no longer welcome in his territory so she's forced to leave. In the wild, this female would just swim away and have another shot at breeding later on.
Females can - and do - kill males during breeding as well, it just doesn't happen often because the males tend to be much bigger. If you take a female and a male of the same size and weight and try to breed them, they're equally at risk of being injured. Many members here that raise groups of aggressive species have ended up with a single dominant female that killed all her siblings.