There is a great story about how this song came to be.
Apparently, Fats Waller was hanging out with Fletcher Henderson. They went out to eat, and Fats ate ten hamburgers. When they were done, he explained that he didn't have any money to pay for them, but he offered to write Fletcher ten songs if Fletcher would pay the bill. According to the story, Fletcher accepted the bargain, and Fats immediately sketched out ten songs.
These songs included "Top and Bottom" (aka "Henderson Stomp"), "Thundering Stomp" (aka "Hot Mustard"), St. Louis Shuffle, Whiteman Stomp, and... Variety Stomp.
Henderson reportedly paid Waller ten dollars for each song, in addition to the hamburgers.
This story may be exaggerated, but it's not the only story like this. Waller supposedly wrote "Minor Drag" in the car on the way to the session where it was recorded. We can't be sure just how true these stories are, but their existence testifies to the ease with which Waller wrote new songs. It seems almost as if they just spilled out of him.