Legendary means belonging to legend: the dragon, the sword in the stone, the city under the lake. It also means so famous that people tell stories about it, which is how you get a legendary striker, a legendary hotel breakfast, a legendary temper.
The two senses sit on a slope and English slides down it happily. A legendary king never existed; a legendary teacher very much did, and is remembered for it. The praise sense is the one you will meet most, and it is warm: calling a party legendary means people still talk about it years later. It works for bad things too, a legendary flop, legendary rudeness. The related noun is legend, which does the same double duty, the old story and the admired person, as in 'she's a legend'.
Legendary began as a noun. In the 1510s a legendary was a book, a collection of legends, from Medieval Latin legendārium and legendārius, on Latin legenda; Old French had legendier for the same thing. The adjective appeared in that same century, and the flattering use, where a legendary barman is a real man behind a real bar, is English stretching the word away from the books it started in.
Medieval Latin
legendārius
English, today
legendary
From legend + ary; from Medieval Latin legendārius. Earlier it was a noun meaning "a collection of legends" (1510s) (Medieval Latin legendārium, Old French legendier), from Latin legenda. In English, both the noun and the adjective first appeared in the 16th century.
Etymology from Wiktionary, CC BY-SA