Rarity

Rarity is a statistic applied to items, blocks and advancements to signify their value and ease in obtaining. The only effect rarity has on an item is the color with which their name appears when selected in the hotbar, moused over in the inventory or produced via the command (but not when viewed in an item frame,  the contents of a shulker box or via statistics ), and has no effect on gameplay whatsoever.

The only way to change an item's rarity is to enchant it, which brings its rarity from Common or Uncommon to Rare.