So, why are rat testicles so large?
A species' sexual anatomy is related to its mating system -- who mates with whom. In species in which many males mate with one female when she is in heat, sperm from all these males is deposited in the female's reproductive tract in a short span of time. A male that deposits more sperm under these conditions will have a higher chance of fertilizing the female's eggs, and hence siring offspring. Males with larger testicles produce more sperm, and therefore have an advantage in such a sperm competition scenario. This is called sperm competition theory, because sperm from different males duke it out inside the female's reproductive tract.
Rats have just such a mating system in which multiple males mate with one female, especially at higher population densities. When a female rat comes into heat, she may be mated by multiple males in a short span of time. The male with the biggest testicles will produce the most sperm, which means he'll have a higher chance of fertilizing some of her eggs.
In contrast, species in which just one male mates with a female during her estrus don't have sperm competition, because the sperm racing to fertilize the female's eggs belong to a single male. There is no need to produce a lot of sperm, so males of such species can afford to have small testicles.
This relationship between testicle size and sperm competition holds true across the animal kingdom, and has been found in mammals (primates, sheep, rodents etc.), birds, amphibians, fish and insects. In fact, testicle size is considered an excellent predictor of a species' mating system. Species in which multiple males mate with a female in a short span of time encounter sperm competition and have large testicles relative to their body size. Species in which just one male mates with a female encounter no sperm competition and have relatively small testicles.
What about the testicles of humans and our close relatives, the gorilla and the chimpanzee? Gorillas are large 400 pound animals, but their testicles are tiny, a little over 1 oz together. Gorillas live in small groups in which one male mates with multiple females -- no sperm competition, hence the small testicles. Chimpanzees are much smaller animals, tipping the scales at 100 pounds, but they have large testicles weighing about 4 ounces together. Not surprisingly, chimpanzees live in groups with multiple males and females, and when a female comes into heat she may mate with several males in one day. This means lots of sperm competition, hence the large testicles.
Humans fall between gorillas and chimpanzees, with a body size around 150-200 pounds, and testicles that weigh about 1.5 ounces. Human testicles are neither especially large nor especially small. This indicates that humans have a mating system that was neither as promiscuous as that of the chimpanzee, nor as exclusive as that of the gorilla. Therefore, sperm competition probably played a small role in the evolution of our sexual anatomy and behavior.