Today, a stool pigeon is usually someone engaged in illegal or shady activities who, to save his own neck, voluntarily turns informer against his confederates.
Earlier, he was someone deliberately planted by the authorities to serve as a decoy to gather evidence against those among whom he was sent to spy upon, or to influence them in some way, such as at the polls.
The modern usage dates to about the first of this century, and the former has been found as early as 1830.
Authorities are in substantially unanimous agreement that both senses are derived from a still earlier literal meaning of stool pigeon, a pigeon fastened to a stool or perch (some say with its eyes stitched closed), thereby serving as a live decoy to entice others into the snare set for them by the hunter.
To the dismay of students of word origins, though, no recorded use of the term in this literal sense has been found earlier than 1836, and even this is only suggestive rather than being a certain instance.
Their belief, however, is supported by the recorded use of stool-crow in the sense of “decoy” in 1811, and of the use of stool alone in the same sense in 1825, this latter being presumably a shortened form of the supposedly earlier but yet unfound stool pigeon.
All these terms are generally accepted as being Americanisms.