The key driving force behind sperm competition is unequal parental contribution to the creation of offspring. In most species the male deposits sperm and that is the end of his biological role in reproduction. In some lower animals the female does the same; for example, corals, kelp, and many species of fish and amphibians release their eggs or sperm into the water and abandon them to their fate. However, species that mate on the land can't do this, so they have evolved mating systems that tend to lead to the female producing larger eggs, or carrying the developing offspring inside her body for a time, and even, in the case of birds and mammals, physically caring for the offspring after they are born.
Since the male's physical contribution is so small, his best evolutionary strategy is often to inseminate as many females as he can; the more babies he makes, the better the odds that some of them will survive to pass on his genes.So for the male, the cost of each mating is small - he's "betting" that if he makes a lot of offspring, some will survive.
The larger the female contribution is, the fewer offspring she can produce in her lifetime. As the potential number of offspring diminishes, the more important it becomes that each offspring she does produce survives to adulthood. The female's mating cost is large, so she has to maximize the likelihood that all of her offspring will survive. Choosing a mate with excellent genes is part of her strategy, and sperm competition is part of that choice behavior.