Codling moth larvae are an important pest of apple trees and to some extent pear trees. The female adult moth lays eggs on apple fruitlets in late spring, and the resulting larvae burrow into the developing apples. They damage the inside of the apple.
Affected apples are easily spotted from the excrement or "frass" which builds up around the entrance hole. These apples may also tend to ripen prematurely, again making them easy to spot.
In most cases the larva drops out of the developing apple after a month or so, although in some cases it may still be feeding when the ripe apple falls to the ground. There is some evidence that the caterpillar feels the thud of the apple hitting the ground, and knows it is time to leave - before animals arrive to eat the fallen fruit.
Once on the ground the caterpillar hides in the leaf litter over winter where it pupates, or in some cases larvae may climb up the trunk of the tree looking for crevices to hide in.
Codling moth is quite difficult to control since there are very few points in its life-cycle where it can be attacked successfully.
For a mild cases treatment consists of finding the affected apples in June and removing them. Since many varieties benefit from thinning at this time of year anyway, no harm is done, and indeed the enforced thinning will usually lead to better crops of fewer but larger apples.
Good orchard hygiene is also effective at controlling codling moth, since the caterpillar is easily removed by cleaning up leaf and fruit debris from the orchard floor.
If you have chickens, allow them to roam the orchard floor, as they are good at finding the caterpillars and eating them.
Prevention in the spring is more problematic because the resulting moths are airborne and even if you have eliminated all the over-wintering caterpillars around your own trees, female moths will fly in from elsewhere. At this point chemical sprays are the only solution. These work by killing the female moths on the developing fruitlets before they can lay their eggs - but the timing is critical.
There is a common misconception that pheromone traps will prevent codling moth attacks. These traps work by luring male moths, but are only intended to help time the application of pesticide sprays - if the trap suddenly fills up with male moths it is time to spray because the females will be active. It is unlikely the traps will catch the entire local male moth population, so fertilised females will still be laying eggs.
Grease bands are ineffective against codling moth, since the majority of larvae pupate on the ground.