In July 1846, while living at the pond, Thoreau was stopped by the local constable for failing to pay the poll tax. He had refused it for several years, on the ground that the government of Massachusetts supported slavery and was prosecuting a war against Mexico to extend it, and that a citizen who pays such a state is a partner in what it does. He spent one night in the Concord jail. Somebody, probably an aunt, paid the tax against his wishes and he was released the next morning, annoyed.
The lecture he gave about it in 1848, published as Resistance to Civil Government and known since his death as Civil Disobedience, argues that a person's first obligation is to do at any time what he thinks right, that a majority rules by strength rather than by justice, and that when the law makes you an agent of injustice to another you should break the law. He is not describing a technique of mass protest and had no interest in organising one.
Others found the technique in it. The essay was read by Tolstoy, and through him and directly by Gandhi, who reprinted it in South Africa, and later by the American civil rights movement. That reception has made a single night in a village lockup one of the most consequential in modern political history, and it happened to a man who spent the following morning going out to pick huckleberries.