Read I Samuel 5 and Acts 17
There was death and destruction all through the city; for the hand of God lay heavy upon it. Even those who did not die were plagued with tumors; and the cry of the city went up to heaven. I Samuel 5:12
Hophni and Phinehas, the two sons of Eli, were atheists. They used their positions as God's priests serving in the Temple before the Ark of the Covenant to satisfy their sinful lusts. Since their perception was the Boss was not present, they behaved accordingly.
The Philistines were not atheists. They believed in the power of the God of Israel. During a battle in which Hophni and Phinehas brought the Ark of the Covenant, the Philistines were terrified. “We are lost,” they cried. “A god has come into the camp. We are utterly lost. These are the very gods who broke the Egyptians and crushed them in the wilderness.” I Sam 5: 7-9. Much to their surprise, they won the battle, utterly defeating the Israelites and they captured the Ark of the Covenant.
When they brought it back to their cities, death and destruction overwhelmed them. They cried a cry that reached to heaven and thus were not utterly destroyed.
Though it was of natural causes, Hophni and Phinehas were killed; and most of the Philistines recovered from their God inflicted plague. But why did God not act immediately and supernaturally to discipline Hophni and Phinehas? Would not this have been a clearer display of God’s righteous judgment? The Philistine people were immediately struck by God’s judgment merely because they were in the wrong place—too near to the ark where He was present.
God always reveals Himself to those who desire His presence. If someone does not want to see Him, He will remain hidden. (At the resurrection of the Lord Jesus, only the Believers saw Him, though at the last Judgment, everyone will see, acknowledge and bow before the risen and living Lord Jesus. Philippians 3:10 & 11)
Hophni and Phinehas had no reason to be atheists. Much more than the Philistines, they knew how God had worked for the redemption of Israel. They were atheists by choice. So God did not speak to them, He spoke by a prophet and by Samuel to their father Eli, and Eli was condemned for not restraining his sons' behavior.
God treated the Philistines much more graciously, for He revealed His uniqueness and His holiness to them. Though we are not told, perhaps many Philistines responded with belief in the Living God during their time of judgment. If they did, we can be sure that God revealed more of Himself to them.
What a very unfortunate response Adam and Eve had when they sinned. They hid from God, hoping He would not see them. How kind of God to seek them out. Even His curse was a blessing, for within the curse to Eve was the promise of a Savior.
My favorite verse, guaranteed, is Hebrews 11: 6 “For whoever would draw near to God must believe that He exists and is a rewarder of those who diligently seek Him.”