My elderly and rather nutty parents live in a house at the end of a lane, surrounded by immense trees. It's like some sort of damp and darker version of Narnia (with fewer fauns and more hedgehogs). They are OBSESSED with feeding animals (my brother has an animal feed business, so they get a lot of free stuff), but they operate some sort of awful policy on 'worthy' animals/birds vs 'unworthy' ones.
For example, they LOVE red squirrels, but they HATE grey squirrels (enough to support people shooting them).
They have robins and chaffinches that are tame enough to eat from their hands, but actively scare off crows because 'they are bullies'.
And yes, having all that birdfood (and the millions of other bits of junk and odd plants and damp leaves) all over the place does indeed attract rats. I once went out of their house and came face to face with a rat. It was sitting on a bird table at eye level. It was honestly about the size of a bulldog and looked like a cross between Phil Mitchell and a corgi, but with a long, scaly tail. For what seemed like about a minute we just stared into each other's eyes, before the rat fled. I think I may also have wet myself a little.
Anyway, I digress. The point is, I can say for certain that bird food does indeed attract rats. I assume that if you put out just a little, though, the birds will eat it and rats won't appear. I suppose there must be some sort of tipping point in the birds v rats graph where the rats start seeing your garden as the place to be on a Friday night, but my parents are so far off the scale, I'm not certain where that is.
Anyway, you'll not be surprised to learn that rats are firmly on my parents' 'unworthy' list. And yet they don't see that they're playing an active part in it.
Mind you, my mother (who turns 86 this year) did once say to me: "I'm not really afraid of getting dementia, I'm more afraid that I might already have it but I've not noticed".
I hope this helps.