What does Matthew 5:12 mean?

Matthew 5:12 KJV
Rejoice, and be exceeding glad: for great [is] your reward in heaven: for so persecuted they the prophets which were before you.

Matthew 5:12 NKJV
“Rejoice and be exceedingly glad, for great [is] your reward in heaven, for so they persecuted the prophets who were before you.

Matthew 5:12 MKJV
Rejoice and be exceedingly glad, for your reward in Heaven [is] great. For so they persecuted the prophets who were before you.

Matthew 5:12 KJV 2000
Rejoice, and be exceedingly glad: for great is your reward in heaven: for so persecuted they the prophets who were before you.

Interlinear KJV

12 Rejoice, /chairo/ and /kai/ be exceeding glad: /agalliao/ for /hoti/ great /polus/ is your /humon/ reward /misthos/ in /en/ heaven: /ouranos/ for /gar/ so /houto/ persecuted they /dioko/ the prophets /prophetes/ which /ho/ were before /pro/ you. /humon/

Albert Barnes’ Commentary

Verse 12. Rejoice, etc. The reward of such suffering is great. To those who suffer most, God imparts the highest rewards. Hence the crown of martyrdom has been thought to be the brightest that any of the redeemed shall wear; and hence many of the early Christians sought to become martyrs, and threw themselves in the way of their persecutors, that they might be put to death. They literally rejoiced, and leaped for joy, at the prospect of death for the sake of Jesus. Though God does not require us to seek persecution, yet all this shows that there is something in religion to sustain the soul, which the world does not possess. Nothing but the consciousness of innocence, and the presence of God, could have borne them up in the midst of these trials; and the flame, therefore, kindled to consume the martyr, has also been a bright light, showing the truth and power of the gospel of Jesus.

The prophets, etc. The holy men who came to predict future events, and who were the religious teachers of the Jews. For an account of their persecutions, see the eleventh chapter of the Epistle to the Hebrews.

{g} “great is your reward” 2Co 4:17