How Matthias Was Chosen to Replace Judas
Peter sets the criteria for replacing Judas. The group puts forward two candidates, prays for the Lord to show his choice, and casts lots.
Scripture
Peter raises the question of Judas's place before a gathering of about 120 believers. He recalls that Judas had been counted among the apostles and had shared in their ministry, yet became the guide for those who arrested Jesus. Peter cites the Psalms both to speak of a place left desolate and to make the case that someone else should take up Judas's office.
The replacement must come from among the men who accompanied the group throughout Jesus's ministry, from John's baptism until the day Jesus was taken up. Peter gives a specific reason for requiring that history: the new apostle is to join the others as a witness to Jesus's resurrection. The group puts forward two men, Joseph called Barsabbas, also known as Justus, and Matthias. Acts records no speeches by the candidates and offers no comparison of their merits.
Only after naming the two does the group pray. They address the Lord as the one who knows every heart and ask him to show which candidate he has chosen to take the place Judas left. They then cast lots, and the lot falls to Matthias, who is counted with the eleven apostles. In the narrative, the lot does not decide who qualifies. It settles the choice between two men already put forward under Peter's stated criteria.