Homer started out as a stray who occasionally wandered into Frey's apartment, but once Frey started feeding her new friend, a bond began to develop, and they've been inseparable ever since.
When Frey's apartment building burned down and she thought all hope was lost, her last good deed was to see that Homer had somewhere safe to live.