The eggs had already been placed on the fruit. These maggots developed into flies and ate their way through your fruit before laying eggs, which hatched into maggots and ate even more of your fruit before pupal stage and emerging as flies.