Acts 1:16

Men and brethren, this scripture must needs have been fulfilled, which the Holy Ghost by the mouth of David spake before concerning Judas, which was guide to them that took Jesus.

Acts 1:16 belongs to the account of the vacancy left by Judas among the apostles. That vacancy was filled only after the disciples prayed for the Lord to show which candidate was suitable, and then Matthias was selected.

The scripture concerning Judas's role as guide to those who arrested Jesus had to be fulfilled. David spoke that scripture beforehand by the Holy Spirit, so the prophecy about Judas was God's word and not merely David's own prediction. The verse thus belongs to the history of the early church that teaches lessons about setting things in order.