the Scripture had to be fulfilled. Ps. 69:25 and 109:8, quoted in v. 20, are applied by Peter to Judas Iscariot, who as an enemy of God had been deposed from his apostleship. Now “his office” (Ps. 109:8) had to be filled again.
the Holy Spirit spoke . . . by the mouth of David. The Holy Spirit inspired David to compose these words using his poetic skills.