When the disciples were choosing (or arranging for God to choose) one to replace Judas, the Bible says they “cast their lots.”
How was this done?
The first mention of “casting lots” is in Leviticus 16:8, with regard to choosing between two goats, one for sin-offering and the other to be the scapegoat: “And Aaron shall cast lots upon the two goats; one lot for the Lord, and the other lot for the scapegoat.” When Israel came to Canaan, the land was to be divided among the different tribes: “The land shall be divided by lot: according to the names of the tribes of their fathers they shall inherit. According to the lot shall the possession thereof be divided between many and few.” (Numbers 26:55-56). And the purpose of casting lots is plainly revealed in Proverbs 16:33, “The lot is cast into the lap; but the whole disposing thereof is of the Lord.” In other words, this was God’s way of showing His selection. And this is why the lots were cast to select a successor to Judas.
The details of the exact method of “casting lots” are not given in Scripture. The scholars who have researched it say that the “lots” were usually small stones, but could be bits of metal or wood. The names of the “contenders” were usually put on the stones, and these were then placed in a stone jar; someone then would reach into the jar and take out one, and the one whose name was written on it would be the one “on whom the lot fell.” There were any number of variations on this, and (apart from God’s purpose for it) many turned it into gambling. Thus, prophecy of the death of Christ on the cross foretold, “They part my garments among them, and cast lots upon my vesture.” (Psalm 22:18). Fulfillment of that prophecy is found in Matthew 27:35, “And they crucified him, and parted his garments, casting lots.”
The thing we must remember about “casting lots” is that God gave the directions for its use, and He controlled the selection made by it. It was not chance that made the choice, but God. When lots were cast to select a successor of Judas, two were put forward: “Joseph called Barsabas” and “Matthias” (Acts 1:23). Then in verse 26, “And they gave forth their lots; and the lot fell upon Matthias; and he was numbered with the eleven apostles.” That is the method by which GOD selected Matthias.