The story
Possibly originally from post to pillar, perhaps a reference to the rapid movement of the ball in real tennis; The Wordsworth Dictionary of Proverbs (1993) notes that from post to pillar dates to at least the 15th century.
Etymology from Wiktionary, CC BY-SA 4.0.