1 and 2 Samuel present the transition of leadership from the judges to the kings and was written during a period that spanned 931–722 B.C. At the beginning of 1 Samuel, the Philistines are ruling. They had been afflicting the people of God for 40 years according to the book of Judges. At the end of 2 Samuel, King David is on his throne. The nation has passed from being harried and harassed by the pagans to a nation with a God-fearing king on the throne. The contrast is further seen in the change of priests who are leading the worship of God. Eli is the priest at the beginning of 1 Samuel but, by the end, there are faithful priests ordering the house of God. The message throughout is that heartfelt obedience is better than heartless sacrifice.