When I carry out pest control in Aberdeen , one of the questions I am asked is”why have I got rats“ or whatever the pest may be.
Rats are intelligent creatures and they will not look a gift horse in the mouth. I am going to give to you straight, usually the customer is to blame, however it it is not deliberate on their part. They like to put out food for birds, they may also put out some water as well, this is just ideal for the rat too. Once he finds the food and water he may decide to find some shelter while he is at it.
Over the years i have found that people are installing wooden patios etc, this has been a great place for the rodent to set up home. It is very important to remove any debris that has accumulated underneath here.
If you are doing your bit for the environment by carrying out composting, may I suggest that you have a look at the CEIH website where you can have a look at their advice on composting to deter rodents.