We have 7 acres, with a neighbor about 300 feet away on one side and nobody else around. The layer flock did wander over to the neighbor's a few times. Fixed it by corralling them for a few days and putting the feeders and kitchen scraps closer to our house versus their pen. They have to come toward the house to get a quick meal, and then they get distracted by the dust baths and the stuff going on on the property. It also helped that I fenced part of our property line to keep deer out of the garden.....and it really helped that the neighbors cleaned up some old feed they had laying in their driveway from their failed attempt at keeping ducks.
One of my friends gives eggs to her neighbor. Despite a fence, her chickens are over there a lot. Lucky her neighbors don't mind and actually feeds the chickens too.