St Matthias was chosen to be the replacement of Judas Iscariot based on the double agency of the human and divine. The election was a close collaboration between the disciples of Jesus headed by Peter and God.
The criteria for the new apostle, as put forth by Peter, was someone who had been with them the whole time, right from the beginning until the day when Jesus was taken up to heaven. Most importantly, someone who was a witness to the resurrection of Jesus. This is sourced from the disciples' experience, which is the human aspect of this election.
On the other hand, they prayed and drew lots to choose between the two final candidates. This is the divine aspect of the election where they depended on God for the final decision. Both candidates were good, but the disciples had to rely on God to choose the better person.
Many times in our life, when we are faced with choosing between two or more good options, we must pray and discern. Let God in during the process of discernment. This discernment must also be fully informed, which means we need to use our human intellect and knowledge. All too often, people mistake by acquiring ill-informed, outdated, or even incorrect data when embarking on the process of discernment.
O God of wisdom, help me with my discernment process; enlighten my mind and show me the way.