They have large eyes and good vision. Selection based on number of factors, primarily visual and olfactory. Once spots host, lands and checks olfactory cues. Ovipositional deterents in some species. The insect marks fruit or what ever after oviposition with a pheromone.
Fruit flies one per fruit.
In some Heliconus species female will check host for other eggs to make sure there aren't any. Insects attacking vertebrate hosts or predators and parasites have the same problems finding their food as herbivores. In general they use the same sorts of clues that plant feeding insects do but there are some differences, particularly for those species which feed on vertebrates. Nature of identifying factors somewhat different. Hosts also have distinct odors but they also provide other clues such as heat.