GOD IS NEVER AMUSED at being treated with contempt, nor by having his explicit instructions ignored or defied.
For then he would not be God.
God is well able to defend himself. In 1 Samuel 5-6, the unfolding account can be as restrained as it is precisely because it is as obvious to the reader as it was to the Philistines that God himself is behind the tragic illnesses and deaths they were suffering. The surprises began with the capsizing of their fish god, Dagon. It soon spread to a plague of rats, an epidemic of tumors, multiplying deaths — and not only in the city of Ashdod, to which the ark of the covenant was first taken, but in other cities to which it was transported — Gath and Ekron. Panic ensued.
But at the end of the day, all the phenomena the Philistines were experiencing could have been natural. That's not what they thought, of course; but still, it was difficult to be sure. So the Philistine priests concoct a test so much against nature that should the test succeed, the people will be convinced that what they are suffering comes from the hand of "Israel's god" (1 Sam. 6:5, 7-9). The cows are separated from their calves and draw along the cart to Beth Shemesh, on the Israelite side: God himself plays along with their superstitions and their fears.
While the Israelites rejoice at the return of the ark of the covenant, "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" (1 Sam. 6:19). There is no reason to think this happened instantaneously. If one had peeked into it and been struck down immediately, others would have been pretty quickly discouraged from doing so. There is no hint that a blinding and consuming light swept out of the opened box and melted the flesh off people, like some sort of ancient Harrison Ford film. Rather, seventy men from Beth Shemesh looked into the ark (which of course was strictly forbidden under pain of death), and doubtless saw what was there: the tablets of stone (apparently the pot of old manna and Aaron's rod that budded had disappeared, perhaps removed by the Philistines). Then the deaths started, all premature, by whatever means — and the only commonality was that they were occurring among men who had looked into the ark. "Who can stand in the presence of the LORD, this holy God?" the people ask (1 Sam. 6:220) — not intending to learn the ways of holiness, but to get rid of the ark — precisely the same pattern as in the pagan cities.
God will not be treated with contempt, nor forever permit his covenant people to ignore his words.
1 Samuel 5-6; Romans 5; Jeremiah 43; Psalm 19