also codpiece, mid-15c., in male costume c. 1450-1550, a bagged appendage to the front of close-fitting breeches, "often conspicuous and ornamented" [OED], from Old English codd "a bag, pouch, husk," in Middle English, "testicles" (cognate with Old Norse koddi "pillow; scrotum") + piece (n.1).
c. 1600, "flaps formed by the lower back of a coat," from coat (n.) + tail (n.). In 17c., to do something on one's own coattail meant "at one's own expense." Meaning "power of one person," especially in politics, is at least from 1848 (in a Congressional speech by Abraham Lincoln); expression riding (someone's) coattails into political office is from 1949.
But the gentleman from Georgia further says we [Whigs] have deserted all our principles, and taken shelter under General Taylor's military coat-tail, and he seems to think this is exceedingly degrading. Well, as his faith is, so be it unto him. But can he remember no other military coat-tail under which a certain other party have been sheltering for near a quarter of a century? Has he no acquaintance with the ample military coat-tail of General Jackson? Does he not know that his own party have run the five last presidential races under that coat-tail? And that they are now running the sixth under the same cover? Yes, sir, that coat-tail was used not only for General Jackson himself, but has been clung to, with the grip of death, by every Democratic candidate since. [Lincoln, speech in Congress, July 27, 1848]
also rat's-tail, from rat (n.) + tail (n.1). Used since 16c. of conditions, growths, or devices held to resemble a rat's long, hairless tail in any way, including "lank lock of hair" (1810); "end of a rope" (1867). Related: Rat-tailed. A rat-tail file (1744) is a fine, round file used for enlarging holes in metal.