Both the "fence" and "woodpile" variants developed about the same time in the period of 1840–1850, when the Underground Railroad was flourishing.
During this time period, both the "fence" and "woodpile" terms for a hidden passage or route developed, mirroring the growth of the Underground Railroad.