Rowling did not know where the name Hogwarts came from when she wrote it down. A friend had to tell her.

The Harry Potter Lexicon quotes an interview she gave the Sydney Morning Herald. When the name occurred to her, she said, "I had no idea where it came from." Later a friend from London reminded her of a visit they had made to Kew Gardens. There they had seen plants labelled with the name. "I'd seen them seven years before," she said, "and they'd bubbled around in my memory."

In that quote Rowling calls them lilies. The plant usually named as the source is not a lily. Hogwort is a common name for Croton capitatus, also called woolly croton or goatweed. It is an annual of the eastern United States whose branching stems are densely covered in light brown woolly hairs, giving it a whitish look. It favors dry, open ground and sandy or rocky soil.

The Lexicon's own entry says she saw hogwort at Kew while quoting her saying lilies, and does not reconcile the two. So it is uncertain which plant was on the label. What the sources agree on is the order of events: the name came first, and the explanation came afterwards.

Rowling has not claimed she chose it on purpose. Wikipedia's article on the plant reports her view that the name had stayed in her subconscious ever since that visit.

The plant name is ordinary English botany. Wort is an old word for a plant. Etymonline traces it to Old English wyrt, "root, herb, vegetable, plant, spice," from the same base as root. It was used in so many herb names that it can be hard to tell which plant an old name means. St. John's wort, recorded from the 15th century, is one survivor. The word went archaic in the mid-17th century but lived on inside plant names.

The school's motto shows the same taste for mock-solemn naming. It is Draco dormiens nunquam titillandus, "Never tickle a sleeping dragon," a Latin tag that sits well beside a name remembered from a garden label.