In Robert Herrick's poem, "To the Virgins, To Make Much of Time," what the virgins and flowers and the sun most have in common is the fleeting time in which they might maintain the glory of their beauty.
The idea is a metaphor, where Herrick speaks to the swift passage of a flower's beauty—lovely today, but faded and dying tomorrow—as well as the glory of the day, soon to see a setting sun. This is the same message that Herrick has for beautiful young women (the "virgins"). Experience allows older people to realize that time passes very quickly. For the young, before they know to expect it (or because they believe life will be different for them), the advantages of youth are gone almost before one can appreciate having them. The comparison to flowers provides a strong reference to outward appearance, but certainly this applies to other things as well: physical strength, intellectual acuity, etc. And the reference to the sun compares a day to one's life, its passage as speedy as that of a flower.
The "carpe diem" poets, of whom Herrick was one, drew attention to "seizing the day," living for the moment—in the moment—so as not to miss a thing. Life, like beauty, is fleeting. So Herrick reminds these lovely young women to live for the present moment: once gone, it can never be retrieved.
Specifically, Herrick writes, about collecting beautiful rosebuds (in lines 1-4), that are gorgeous today, but dying tomorrow:
And this same flower that smiles to-day
To-morrow will be dying.
In lines 5-8, Herrick now concentrates on the passing of the day, the swift movement of the sun through the heavens. This is a metaphor for the passage of life: how quickly the sun is rising, as in the days of our youth, to soon be on the downward arch toward sunset, which is the same as approaching evening—or death, when compared to the lifetime of a person.
The glorious lamp of heaven, the sun,
The higher he's a-getting,
The sooner will his race be run,
And nearer he's to setting.
Clearly, Herrick reminds the young women that their beauty—and ultimately their lives—are filled with promise and fullness today. However, like the flowers and the sun, which are metaphors for beauty and life, time moves along quickly until these aspects of young life are gone forever.