The Philistines continue to be a problem for Israel, just like they were for Samson. The people decide they can win the battle if they take the ark of the covenant, a symbol of God’s presence, into the battle with them. They believe they can manipulate God into fighting on their side. The plan does not work, and God judges Eli and his sons.
People still believe they can manipulate God for their own purposes. If we just say the right words or have enough faith or make convincing promises to him, he will give us what we want. God operates as he chooses. We can ask him for things, but we need to have the faith to believe that the outcome he chooses is the one that is best.