He cannot gain or lose anything. His perfection, His righteous and goodness. God could easily have constructed a universe where all people obey Him as naturally as plants turn to face the sun. Instead, He desired that those who serve Him choose to do so of their own free will. Therefore we should not imagine that God merely has the ability to intervene in history, but realize that He ratified and established every action that would take place before the dawn of time.
History contains evil.
Evil is not from God, but originates in the free will of God's creatures as they rebel against His will. By their own free will, our first parents alienated themselves from God. God's plan, however, had taken this into account from the beginning, and provided a means for mankind to choose once again to serve and follow Him in the person and saving work of His Son, Jesus Christ. In Romans chapter 8, Paul gives us a schematic treatment, so to speak, that links God's overall plan with His specific plan for individual believers. Having been foreordained and called , we are justified at the point of faith in Christ.