For theologians it is a tricky question and many theodicies have been suggested such as; finite man cannot possibly understand an infinite (inscrutible) God or for man to attain the highest virtues, to become more perfect, it is necessary for mankind to suffer. The latter does not explain why it is necessary that some should suffer more than others or why children should be harmed but all religions require a leap of faith with some of their beliefs.
Far easier to explain that evil manifest in mankind (moral evil as opposed to natural evil) is simply a product of natural selection and survival of the fittest.
Take the cuckoo as an example. To raise its young he must kill the issue of another species of bird and lay its egg in their place. By this means it not only murders its kids but defrauds the host bird of time and assets. From the host birds point of view it has been sinned against (without remedy). Nature has introduced sin to enable one species to take advantage of another by means of murder and fraud. What makes it different with humans is that we have developed a code of conduct in an effort to curtail natural instincts to take advantage of others to further their own interests. This is entirely arbitrary as the cuckoo would insist he hasn't sinned but humans in an attempt at civilised society have adopted a set of rules not dissimilar to those mentioned in the ten commandments.
But where does God fit in, if at all?
It is difficult to see how if we accept that good and evil are just two ends of a one dimensional continuum. see the diagram.
Everybody sits somewhere on the line; there is no mystery, no room for spirituality in the orthodoxy. If, however we think of good and evil as part of a three dimensional set up as shown, it can be shown that at any level of goodness we can identify extremes. Take the trinitarian equation which shows the relationship between our perception of goodness and its components.
Perceived goodness, G = ±√[ (+g)² + (-g)² + (ig)²]
where '+g' is the real goodness (good), '-g' is the unreal goodness, (evil) and 'ig' is the imaginary goodness ('i' is the square root of minus one).
Solving we have perceived goodness, G = ± g. As with the one dimensional view we have the answer good and evil. Only now we have what we've referred to as 'imaginary' goodness. It is absolutely necessary but does not itself appear in the answer. Is this the goodness of God (or Satan) or is it merely the intrinsic goodness of mankind?
The trinitarian equation is a fundamental component of The Davies Hypothesis