The Philistines have had enough of the curses brought upon them in 1 Samuel 5. Though they captured the ark of the covenant, it has brought them nothing but grief. So, they decide to send the ark on its way back to the people of Israel – putting it on a cart, and placing gold offerings in a chest beside the ark (see 1 Samuel 6:8). It’s very important to note that they didn’t put the objects inside the ark, but beside it. Did the Philistines ever open the ark? Or did they know enough about it to realize that doing so might be fatal?
So, they send the ark on its way, and the cows take it to the town of Beth Shemesh, where some of the Israelites live. They rejoice that the ark has been recovered, but then we read:
But God struck down some of the men of Beth Shemesh, putting seventy of them to death because they had looked into the ark of the LORD. The people mourned because of the heavy blow the LORD had dealt them, and the men of Beth Shemesh asked, “Who can stand in the presence of the LORD, this holy God? To whom will the ark go up from here?” — 1 Samuel 6:19-20
While it appears that the Philistines must have known not to look into the ark, some of the Israelite men simply can’t resist. And the penalty for gazing into the ark was death for them. While I cannot say with absolute certainty that the Philistines did not look into the ark, I think it is safely inferred because they weren’t put to death, and there is no mention of the items inside being stolen. But God’s own people seem to have committed the sin that even the Philistines did not.