A rat race is ... a simple game of "follow the leader" in fighter planes. The leader does everything he can think of — Immelmanns, loops, snap rolls, and turns, always turns, tighter and tighter. [Popular Science, May 1941]
In the 1930s actual rat races of some sort are frequently mentioned among popular carnival and gambling attractions. Meaning "fiercely competitive struggle," especially to maintain one's position in work or life is by 1939. Rat-run is from 1870 in the sense of "maze-like passages by which rats move about their territory," but originally and usually in a derogatory transferred sense.
[Matthew] Milton was not, at the period we write of [c. 1811], at all in the ring ; for in the following March he was steward of a rat-race, held at a public-house in Shepherd's-market, where four of these "varmin," decorated with different coloured ribands, were started for a sweepstakes, round the clubroom, before a host of sportsmen. ["Sporting Incidents at Home and Abroad," The Sporting Review, May 1848]
*rēd-, Proto-Indo-European root meaning "to scrape, scratch, gnaw."
It forms (possibly) all or part of: abrade; abrasion; corrode; corrosion; erase; erode; erosion; radula; rascal; rase; rash (n.) "eruption of small red spots on skin;" raster; rat; raze; razor; rodent; rostrum; tabula rasa.
It is the hypothetical source of/evidence for its existence is provided by: Sanskrit radati "scrapes, gnaws," radanah "tooth;" Latin rodere "to gnaw, eat away," radere "to scrape;" Welsh rhathu "scrape, polish."