If I've understood this correctly (from what I'm learning at http://edu.kabbalah.info/ )there are usually four main ways people try to explain away the mix of good and bad in the world:
1. Nature (the world) evolved according to certain Darwinian and scientific rules. It has no mind. It does no good to pray to anyone as there is no-one to hear those prayers. The best we can do is seek to amass wealth, happiness and ongoing genetic continuance by competing the best we can with others for limited resources.
2. Someone or something created the world but has since moved on to another project and have left us to muddle along the best we can.
3. All the evil in the world is the fault of an anti-god force which balances the good of a god force. Through this polarity we know what is good because we can compare it to the bad.
4. The world was created as a playground for sometimes fickle collection of gods, much like as in Greek Mythology. They're not really interested in our needs, we're only here as ornaments and playthings in their garden. The best we can do is to try and placate them and stay on the right side of them through beseeching them and making offerings or sacrifices.
My recent reading of "The Twelfth Insight" by James Redfield, watching http://www.kabbalah.info/engkab/kabbalah-video-clips/introduction-to-kabbalah as well as what I have understood from the comments of various South and North American indigenous thinkers of our time I think there another theory. This theory also has a basis in recent scientific understanding as interpreted by the likes of Amit Goswami, Lynne McTaggart and Ervin Laszlo.
We are part of a mass of vibrating particles/waves. The fact that we perceive ourselves and the world around us as separate forms is an illusion created by our minds. The illusion is pretty "cool": it allows as to act in this world, to touch, see, hear, taste and observe the elements of this perceived world. We can go "wow" at the snow covered mountains and the silver edged clouds in the sky, smell the rich aroma of freshly ground and brewed coffee, taste the melting chocolate in our mouth, listen to chirping of newly hatched birds and insects on spring day and touch the soft fur of a puppy dog. However our perceived separateness leads us to egotism: the pursuit or happiness and the escape from pain, at the possible expense of others. Egotism in itself is not escapable as it is as natural as breathing, our error is in pursuing egotism for just our perceived bit of the universe without understanding the reality of our connection with everything else. We need to be egotistic for the whole mass of vibrating particles/waves and all the space in between that make up our collective universe.