The figurative language in this verse from Part 1 of the Dhammapada is used to convey a moral lesson. Specifically, the language draws a comparison between two types of people: fools and wise men.
The "vanity" that fools follow after is a metaphor for things that are superficial, fleeting, and ultimately meaningless. This could include material possessions, social status, or other forms of worldly success that are not grounded in deeper values.
It encourages the reader to strive for a deeper sense of purpose and meaning in their lives, rather than being swayed by external pressures or fleeting desires.