You know the first verse; almost nobody knows there are five. The poem is The Star, written by Jane Taylor and published in a London book for children in 1806. The tune is older still - a French air printed in 1761 that Mozart borrowed for a set of piano variations. Two centuries on, it is the first song most English-speaking children learn.
The famous line is a simile, and the most useful one in the language for learning what a simile is: . The star is not a diamond; it is like one. English hangs comparisons on that little word constantly, and this is where native speakers first met it.
Twinkle itself is worth a moment: to shine in small, quick flashes. English keeps a whole family of these light-words - shine, flash, sparkle, glow, twinkle - each a slightly different behaviour of light, and songs are the painless way to collect them. Taylor's later verses (the ones nobody sings) add blazing for the sun, the loud end of the same family - worth knowing the poem keeps going even though the song, like this recording, stops after the verse everyone knows.