According to Webster, a whirligig is a "child's toy that is whirled round."
In common usage however, they are mechanical windmills. Simply put, it is a weathervane that does something other than rotate into a position that will indicate the wind direction.
A whirligig is a working or playing figure mounted on a chassis and powered by a wind driven propeller. The whole assembly turns into the wind to pick up the slightest breeze, just like a weathervane. In addition the wind velocity can be gauged by the relative briskness in movement of the associated figure.