Old English ranc "proud, overbearing, showy," from Proto-Germanic *rankaz (source also of Danish rank "right, upright," German rank "slender," Old Norse rakkr "straight, erect"), perhaps from PIE root *reg- "move in a straight line." In reference to plant growth, "vigorous, luxuriant, abundant, copious" it is recorded from c. 1300. Related: Rankly; rankness.
Sense evolved in Middle English to "large and coarse" (c. 1300), then, via notion of "excessive and unpleasant," to "corrupt, loathsome, foul" (mid-14c.), perhaps from influence of Middle French rance "rancid." In 17c. also "lewd, lustful."
Much used 16c. as a pejorative intensive (as in rank folly). This is possibly the source of the verb meaning "to reveal another's guilt" (1929, underworld slang), and that of "to harass, abuse," 1934, African-American vernacular, though this also may be from the role of the activity in establishing social hierarchy (from rank (n.)).