There was a very rich man amongst the children of Israel who did not have children to inherit from him, but he had a nephew. His nephew came in the night and killed him when nobody saw, because he wanted the money. Then he took his corpse to another town and placed it in front of one of the houses in that town so as to frame the owner of the house with murder, or even to place the blame on the people of that town so that they will pay the blood money as was the custom of the time, unless 40 of their men were able to swear that they did not kill the man. The people of the town denied having anything to do with the murder of the man hence every group denied any blame on themselves.
The dispute became serious between them to the point that they had to go to Prophet Musa u to ask him to ask Allah U about the murder. So, he said to them to slaughter a cow.