If the area is not secure and there are predators such as foxes nearby, your ducks may fly to escape the predators. In the fear of the moment, they might fly far to get away from the threat and get lost.
Ducks will go in search of food if they are not properly fed. If they cannot find food in your backyard, pen, or housing you provide for them, they will go off in search of food.
Ducks will take to flying when playing or feeling very excited. When they play with each other, they are happy but also distracted. However, while your ducks might fly around when excited, they are not likely to fly too far or get lost.