It's unclear exactly why people started to use rat in this way, but there are some possible explanations. Rat, as an epithet, has long referred to many different kinds of dishonorable people. Before calling someone a “rat” meant calling them an informant, it signified a drunkard, a cheating husband, or a pirate.