The priests and diviners advised the Philistine leaders to present an offering to appease the God of Israel in order to end the plague. In their understanding, the God of Israel was another deity among many, who had won some sort of contest with their god Dagon.
Trespass offering – the gift was to be a compensation for trespassing against God by capturing the ark. By sending the gifts back with the ark, the Philistines acknowledged that it was God who had afflicted them with tumors.
7 Now therefore make a new cart, and take two milch kine (milk cow), on which there hath come no yoke, and tie the kine to the cart, and bring their calves home from them: 8 And take the ark of the Lord, and lay it upon the cart; and put the jewels of gold, which ye return him for a trespass offering, in a coffer by the side thereof; and send it away, that it may go. 9 And see, if it goeth up by the way of his own coast to Bethshemesh, then he hath done us this great evil: but if not, then we shall know that it is not his hand that smote us: it was a chance that happened to us. … And the kine (cow)took the straight way to the way of Bethshemesh, and went along the highway, lowing as they went, and turned not aside to the right hand or to the left; and the lords of the Philistines went after them unto the border of Bethshemesh.
–> The Hebrew literally reads “along one highway,” indicating that the coows did not deviate onto any side roads. The lowing of the cattle was their plaintive crying for their calves. These cows were drawn by a strong power in the opposite direction from where their natural inclination would lead them. This would make an undeniable impression on the Philistine farmers, who knew the strong maternal instills of cows.
19 And he smote the men of Bethshemesh, because they had looked into the ark of the Lord, even he smote of the people fifty thousand and threescore and ten men: and the people lamented, because the Lord had smitten many of the people with a great slaughter. 20 And the men of Bethshemesh said, Who is able to stand before this holy Lord God? and to whom shall he go up from us? 21 And they sent messengers to the inhabitants of Kirjathjearim, saying, The Philistines have brought again the ark of the Lord; come ye down, and fetch it up to you.
–> The Lord brought judgment upon certain men of Beth Shemesh who were guilty of the presumptuous sin of gazing into the ark. They had shown a lack of reverence for the holy things of God and head directly violated Mosaic law (Num 4:20). Since God is holy, He requires those who minister or serve Him to be separated from all that is contrary to His holy characters.