Rats are attracted by easily accessible food sources such as open garbage cans or pet food left outside. They also seek shelter in areas with clutter or gaps in the building structure.