This is not a proverb that explains why bad things happen to Wylie Coyote - even though at first glance it might. It is actually about those who plan to do evil to others. Those who set traps to catch others and have bad things happen to them are warned in this proverb that what they do will eventually happen to them. Let's take a look at what this means - and also see an example or two.
Those who dig a pit do so to catch someone in it. In biblical times people would dig pits and cover them for the purpose of catching more than just animals who would fall into them. These pits would be dug and covered with camouflage as well as wetted down on the sides so that whoever was caught in them would not have opportunity to escape. Those who caught the person would then either take them captive as a slave - or kill the one who fell into the pit. The reason a stone would be rolled is to be put on a steep hill so that it could then be rolled down to kill or badly injure someone who was coming through the valley. This was a tactic of thieves who wanted to steal what travellers would have as they went through valleys and along roads that were next to hilly or mountainous areas. The idea with a pit or with a stone was to injure or kill someone for evil purposes.
God warns that those who do such things will fall into a pit themselves. God also warns that the stone that is rolled with come back on them. This is not a reference to an actual pit or an actual stone rolling on them - but was a warning that God was going to hold them responsible for their wicked actions. A good example of this would be the story of Joseph and his brothers. The brothers threw Joseph into a pit with the original intention of killing him because of their jealous hatred of him. Joseph and his stinking varicolored coat reminded them every day that their father loved him more than them - so why not teach the little runt a lesson. Of course killing your brother is a little intense. In the end they decided just to sell him into lifelong slavery (their sibling rivalry was way more intense that what I remember with my brothers). They covered their tracks by dipping the hated coat in blood and telling their father that a wild animal killed Joseph. But the pit they dug - and the rock they rolled was going to come back on them one day.
The first "pit-experience" was when their father almost died from grief. Then there was the famine that came and caused them to have to go to Egypt where they had to ask for food from . . . wait for it . . . their snotty little brother who was now the second ruler of Egypt. What was very good for them was that their brother had far more mercy on them in their pit that they had on him when he was in theirs. They had rolled their stone on him - but he refused to roll his on them. He chose forgiveness rather than revenge.
The varied pits that you can fall into are as numerous as the ones you dig for others. It is amazing as I grow older to see all the various pits that people have fallen into after they've dug ones for someone else. It is a fact of life that what goes around comes around. That is the simple, one-sentence way to define this particular proverb. I just hope that we all remember that the next time we grab our shovels and start digging for someone else.