a rare and costly substance, most likely red coral, held up as a measure of the greatest earthly worth
This word names one thing: a rare and expensive substance that the biblical writers treated as among the most valuable goods money could buy. Its exact identity is uncertain, and it was already unclear in ancient times, but the best evidence points to red coral, the branching red material harvested from the Mediterranean and traded as a luxury across the ancient world. Older tradition read it as pearls, and the King James Bible chose rubies, so English versions vary widely.
In five of its six appearances the word does a single job: it marks the ceiling of material value, so that something greater can be shown to rise above it. Wisdom is worth more than it (Proverbs 3:15 and 8:11), a faithful wife is worth far more than it (Proverbs 31:10), and the great poem on wisdom in Job places it at the top of a list of treasures only to say that wisdom costs more still. The argument never depends on knowing exactly what the substance was. It depends only on everyone agreeing it was extremely expensive.
The sixth appearance is different in kind. In the book of Lamentations the poet is not weighing value but describing color, saying that Jerusalem's princes were once redder than this substance. That single verse is the strongest clue to its identity, because a comparison to something red fits coral far better than it fits the white pearls of the older reading.