For my operation I run pretty minimal fences in the interior of my farm. This means that I sometimes have animals get out, but it's usually not a problem. Occasionally they eat something that I'd rather they not. This group of pigs is heading up my tractor road because they think the wood chips on the road are tasty, or maybe something buried in it, or growing in it. I'm not sure.
Our interior fences aren't piglet-proof. So around this age, 3-4 months old, we start to see groups of piglets that go on road trips, investigating things and having a good pig time. I've trained my dogs to be clear about the rules: Pigs inside the white electric fence, dogs outside, so when the dogs see a group of piglets like these they sally out and drive them back into the pasture. The pigs aren't sure why they're running back, but pretty quickly the pigs recognize the white line as the boundary, which is what I want them to get. When they're small like this the interaction with the dogs makes sure they respect them when they're larger.
When they get about 150lbs they get moved out to the main pig herd for the rest of their growout.