This begins to deal with the problem as does the famous "Footprints" where Jesus says that when there are only one pair of footprints in the sand He is carrying the Christian. But they both leave out the other fellah. My life is not lived under the influence only of God, but also of Evil: The Devil; He whom Jesus referred to as the Prince of this World. He leaves a third set of footprints along life's path. And as St Paul says: We fight not against flesh and blood but against Evil Spiritual powers (Ephesians 6 v12). To say that God weaveth sorrow is partially true. Better to say that He allows sorrow and can and does bring Good out of it. Salvation comes not simply by believing in Jesus Christ but by taking up the fight with Him.
And God allows a great deal of sorrow arising from the way the Earth works (natural disaster and sickness) and the way the Devil is allowed to encourage sin which harms the innocent as well as the guilty (war and terrorism, greed and bullying). Some of these can be given probabilities arising from the way we behave: For example it is just as reprehensible to provoke violence as it is to engage in it, but much sorrow arises from random events: a school bus just happens to pass as a terrorist bomb goes off, for example. See Elastic and other probabilities.
And God rarely intervenes. The big question is Does Prayer bring about His intervention?. We always hope so. But we have to accept that many times He does not. Some folk get around this by saying He always answers and sometimes says NO; Or: He always answers, but sometimes in a way different from what we expect. Both are no doubt valid in many circumstances, but it doesn't always help very much in understanding or coping with such sorrows and there are other circumstances when He simply seems not to be listening.
So what conclusions do we draw? First we have to put alongside the negative thoughts of the above the situations when God's intervention is fast and breathtaking and then say This is how it is meant to be. Life is designed to be full of uncertainty and will remain so even aligned with Jesus Christ. However if we take up the fight alongside Him, He will likewise take up the fight alongside us and Nothing but Nothing including SIN will separate us from the Love of God. (Romans 8)
And what about my prisoner friend? Yes it is largely chance that he is in the situation he is. He had to cope with temptations which, fortunately few of us have. They arose from the accident of his birth. God allowed it (and so did a number of others who could have done more!) And God can redeem it. And I pray that He will.