"The lot is cast into the lap, but its every decision is from the Lord"
There is no such thing as chance in the Universe that God created. He is sovereign and in control. Sure, there are things that he allows to happen as overagainst those that he makes happen, but there is nothing that happens that He does not approve and that He does not authorize.
This is a rather strange idea in our day and age of belief in the randomness of events. We don't know what to do with coincidences. We want all things to be predictable or all things to be random. What we are not really prepared for is a Sovereign God who decides what He allows and what He causes. We can decide and we can move forward as long as it is in His plan. We cannot, however, do anything that will derail His ultimate plan for the universe.
In more biblical times there was the understanding of God's providence rather than luck. People understood that if God in His providence permitted a thing to take place and it was a good thing, then it was something that should be pursued. God allowed a person to move in a direction or disallowed a certain direction to be pursued.
Yes, God does allow people to sin and harm others. This is hard to understand, but it seems that it serves a great good and greater glory for God. Many have understood that God's willingness to permit some sin allows for true love. If there is no real love through real choice, then we would be only robots on invisible strings. God has sovereignly allowed rebellion and choice to exist within certain boundaries to allow for real love.
The lot as it is described here was an ancient way of deciding issues when it was not clear which decision was God's among a number of clearly good decisions. This was an ancient Hebrew way of submitting the decision to God. The Hebrew did not cast lots over whether it was right to steal or murder or commit adultery. Those were moral decisions. But when two ways seemed equally good and equally appropriate, then lots were used to signal God's direction. If one way was clearly inferior to another, then that kind of decision was not submitted to the lot process.
In the New Testament era we have the guidance of the Holy Spirit and the more sure word of God to help guide us and make these kinds of decisions.
Solomon is saying so many things with this proverb. God is in control of everything, even the throwing of a dice. There are times when you don't know which of two good ways to choose. There must be a way to submit a decision to the Lord that is real and practical.