Good and evil are two basic fundamentals of religious, and especially Christian, thought. Traditionally religion is sometimes thought as of a battle between God who represents the side of good versus the devil or Satan that represents the forces of evil and influences humans to perpetrate acts of evil. Religious thinkers have battled over the reasons for the existence of evil in the world since this school of thought, formally known as theodicy, began centuries ago.
Evil can be categorized in two different ways, moral and natural evil. Moral evil can be described as instances of causing pain and suffering both physically and mentally. Moral evil defines all instances of pain and suffering which is not for the benefit of the individual (or other organism). Not all pain and suffering can be described as morally evil, only evils which human beings can held morally culpable for, where the inflictor of pain is intentionally and/or knowingly performing a morally wrong action. For example instances where a child is accidentally run over because of running out between two parked cars is not morally evil.
Moral evil therefore depends on the choice of each free-willed person, that is they have the choice to do good or evil in each situation. Due to the concept of free will, God is unable to prevent humans from committing acts of moral evil. If God did remove the ability to choose from the world, then theists would argue this would create an inferior world. Without the ability to commit acts of moral evil a higher good, derived from making the correct choices, would be impossible to achieve.
Natural evil on the other hand is defined by instances of pain and suffering, both mentally and physically, where human agents cannot be held morally blameworthy. For example, cancer, viruses, genetic disorder, natural disasters like floods, drought, famine or plague or an act caused by an animal such as a shark attack.
Natural evils are seen as an act of God rather than man, because of the reasons described above, and are therefore much harder to explain or reconcile with God's innate goodness. For those who categorize themselves as creationists, God was involved in the world's creation and is still involved in the world as it is. Therefore his acts of creation and planning have led to a world where natural evil can occur. Some would say that natural evil is a way of punishing humans for their morally wrong actions. Another interpretation is that natural evils are to be overcome in order to allow the individual to achieve the greater good or give an opportunity for the individual to grow through the feeling of pain and suffering -- much like the reasons why free will exists for humans.
On the subject of good on the other hand, in Judeo-Christian theology there is God who is good by his nature and also by his actions. Thomas Aquinas argues that God is good. Aquinas argues that God is good because of his being as pure act. Whatever exists has actuality by virtue of the fact that it is, and whatever has actuality is in some way perfect, for the lack present in its potentiality to exist has been overcome. Therefore everything that exists is in some way perfect. Taking this one step further, since perfection implies goodness, all creations in the world are good by virtue of the fact of their existence. Essentially God is good because of his innate nature. This leads to the second proof that God is an agent of good in the world as whatever God does, since his acts must accord with his nature, must be good. Thus Aquinas writes, "God cannot do anything except that which, if He did it, would be suitable and just."
If you believe that God created the world then also he must have created evil for a purpose that is within his grand plan. A plan that as previously discussed must be to achieve a form of greater good. This argument therefore explains the creation of natural evil in the world as mechanism for the achievement of the greater good.