The proverb is apropos of the fact that a successful person is surrounded by the myriads of people just like candlelight attracts the moths. A lot many Sycophants and flatterers find their way around the people who are successful in some way in worldly life. The time servers will do so in order to solve their own problems and difficulties and get to their own way when their interest is accomplished.
A successful politician, for instance, is surrounded by the crowds of people as long as he’s in office but when he’s left the job, only time tested and true friends would accompany him anymore. The friends of feastal hours would part their ways when their ulterior motives are satisfied.
A high echelon official would also find so many people around himself praising and commending him in order to grind their own ax. They chase the power bearers to get their own wishes fulfilled.
When a person’s socio-economic state is pitiable, he would have fewer relationships and friendly circles. Sometimes, he may find it hard to get a due place in the nuclear family but when he gets the power, money, or that socio-economic status he’d be having the huge followings soon thereafter. He may be contacted by the extended family members and distant friends after he occupies some worldly position in life.
The example of Govind Jaiswal, who is the topper of the IAS Examination in India, is best suited to the proverb. He belonged to a poor and very low-income class and was even forbade to play with his upper-class friends. But when he topped the exams of Indian Administrative Service, he became somebody out of nobody all of a sudden. People were not kind to him in the hours of his hardships and tested times.
An industrialist can court friendship even in government circles for hooking certain advantages to flourish his business empire. A Sycophant works on his fishy interests and left the other people when they are out of power and prosperity. Such people also perform wrongdoings just to get fulfill their own fishy motives in return from powerful and well-placed people in society.