Jesus was quoting Psalm 22 to point us to the fact that He was fulfilling ancient prophecies at His crucifixion. The psalm was well-known to the Jews at the time of the Christ, and they would have recognized it very quickly just as anyone today would recognize a popular song.
Psalm 22 is a prophecy by King David about the coming Messiah, and was written about 1,000 years before Christ came to Earth. Comments in parentheses below mine:
1 My God, my God, why have you abandoned me? ➤ fulfilled in Matthew 27:46; Mark 15:34
7 Everyone who sees me mocks me; they sneer and shake their heads ➤ fulfilled in Matthew 27:39; Mark 15:29; Luke 23:35
8 “He relies on the Lord; let Him rescue him; let the Lord deliver him, since He takes pleasure in him.” ➤ fulfilled in Matthew 27:43
16 My enemies surround me like a pack of dogs; an evil gang closes in on Me. They have pierced My hands and feet. ➤ fulfilled in John 20:25
17 I can count all My bones. My enemies stare at Me and gloat. ➤ fulfilled in Luke 23:35
18 They divide my garments among themselves and throw dice for My clothing. ➤ again, fulfilled literally at the cross. See Mark 15:23-25, Luke 23:33-35, John 19:23-25
But keep reading and see what happens next:
27 The whole earth will acknowledge the Lord and return to Him. All the families of the nations will bow down before Him. (worship of Jesus)
28 For royal power belongs to the Lord. He rules all the nations. (Jesus is God)
29 Let the rich of the earth feast and worship. Bow before Him, all who are mortal, all whose lives will end as dust. (worship of Jesus as God)
30 Our children will also serve Him. Future generations will hear about the wonders of the Lord. (worship of Jesus as God)
31 His righteous acts will be told to those not yet born. They will hear about everything He has done."
That is Jesus, the King of kings and Lord of lords!
He is no mere man.
He is The Royal Son of God, Himself God, to Whom all will bow down and worship, with no exceptions.
For more prophecies fulfilled by Jesus at the cross, see also Isaiah 53.
I will also need to update this article to include a couple more verses which were fulfilled by Jesus.
Jesus, the Cross and the Megaphone
Was Jesus Crucified?
Who Said Messiah Would Go to the Cross?