Part of the story is likely that the Psalms underwent fudging (or, to be polite about it, inept translation) from the Septuagint.
The word in Psalms 22:16 or 17 (depending on who’s doing the counting) is ka-’ari (here, the character ‘’’ is used to represent the Hebrew “aleph”). It is asserted by some that this word is derived from root K-R-H, meaning “to dig” (a side note: in Hebrew, and the Semitic languages generally, the basic meaning of a word is carried in the (usually, but not invariably) triconsonental root; the exact meaning, and the part of speech, is expressed by the vowels). The problem with this hypothesis is that aleph, often though of by those who do not speak a Semitic language as silent, really does have a sound (the glottal stop), which gives us a transformation of K-R-H otherwise unknown in Hebrew. Moreover, K-R-H has the meaning “to dig”, and is never used in the sense “to pierce”; nakar is most likely in this context (although other words from other roots are possible).
So what does ka-’ari mean? The proper translation is “like a lion”. The Psalmist is moaning, “Like a lion…my hands and my feet!” (cf. verse 1: “Far from helping me…the words of my roaring”). Note that imagery of a lion as enemy is used several times in this Psalm.
Psalm 22:18 or 19 reads: “They divide my clothes among them, and for my garment they cast lots”. In this case, the authors of the gospels have misinterpreted the parallelism of Hebrew poetry (cf. Zechariah 9:9), and have tried to divide the single act referred to in the Psalm in an emphatic way into two separate acts.
“Kings die, and leave their crowns to their sons. Shmuel HaKatan took all the treasures in the world, and went away.”