A rat was a type of rodent that was larger than a mouse. They were typically found on Earth as well as a variety of worlds. In laboratories, Humans would test rats response to stimuli by placing them in mazes and giving them a treat if they succeeded in getting out of the trap. The treat was often a piece of cheese.
In 1334, Flint observed rats carrying Bubonic plague while he was walking the streets of Constantinople. These rats, just as many Humans did during this period, perished from the plague. (TOS: "Requiem for Methuselah")
In early 2365, while the USS Enterprise-D was entrapped in a void, Chief Engineer Geordi La Forge stated out loud, "Like the rat said: Keep the cheese. I just want out of the trap." Later, Doctor Katherine Pulaski would liken the situation of the Enterprise-D to that of a rat in a maze. (TNG: "Where Silence Has Lease")
A year later, Odo snuck aboard a Kressari freighter and disguised himself as a rat again to investigate allegations by one of Quark's contacts that the Kressari were arming the Bajoran extremist group known as "The Circle". (DS9: "The Circle")
After she learned about the Srivani experiments on her crew, Captain Kathryn Janeway told Alzen that "these lab rats" are fighting back to demonstrate that she won't cooperate with the Srivani. (VOY: "Scientific Method")