Coffee's bitter compounds are responsible for its repelling effects. These compounds make the coffee unpalatable to rats and mice. They will avoid areas where there is the use of coffee grounds.