Galadriel was well known throughout Middle Earth as a wise and gentle ruler of her people. It was also known that she personally educated Elrond, before sending him to establish his own realm.
So it was hardly surprising that Thranduil, King of Mirkwood, should send his forty-five-year-old son and heir to benefit from her wisdom.
Galadriel accepted Legolas as an apprentice, and trained him in all the arts he would need to know, should his father die and he inherit the throne, though of course this was not expected to happen.
On the night of his fiftieth birthday, before she sent him home, Galadriel educated Legolas in one last thing, as she had for all her apprentices before him. She taught him the things he would need to know for marriage.