"I noticed, in my search of the park, that considerable damage seems
to have been done to a very valuable Whomping Willow,"
This is the quote by Professor Snape mentioned in the comment
This is the quote by Lockhart
"Just been showing Professor Sprout the right way to doctor a Whomping
Willow! But I don't want you running away with the idea that I'm
better at Herbology than she is! I just happen to have met several of
these exotic plants on my travels . . ."
So at least according to him they are a species of plant and so, probably how the one planted in Hogwarts behaves is in it's nature
But then again, it's Lockhart so we can't be certain.
Here's a forum discussion on the same topic: The Whomping Willow