Dogs are smart, curious, and capable. They also understand boundaries. If you have a large property it is surprisingly difficult to prevent a motivated dog from leaving it. Some dogs have a strong desire to go on a walkabout on occasion. Chaining a farm dog defeats their purpose, and is arguably inhumane, so for some of them it just comes with the territory.
We had one dog growing up that liked to commune with a particular herd of cattle (in a friendly way) in a distant field on occasion, and nobody and nothing could stop it when it had that inclination. Dog on a mission.