What is the purpose of the silky hair in corn on the cob?
Simply stated, it's all about sex. Corn is a monoecious plant, which produces both male and female flowers on the same plant. Both flowers are initially bisexual (or "perfect"), but during the course of development the female components (gynoecia) of the male flowers and the male components (stamens) of the female flowers abort. The corn silk growing out of the ear is the female part of a corn plant, and the tassel growing out the top of the corn stalk is the male part.
The corn silk is the stigma and style of the female part of the corn. The stigma is the sticky end of the silk where pollen attaches. The style is the tube from the stigma to the ovary, where the embryo (kernel) forms on the fruitcase (cob). Every ovary (a potential kernel) has its own strand of corn silk.
Pollen forms in the anther on the corn tassel. As the pollen matures, it is released and carried by the wind to the female stigma of nearby corn plants. The pollen then travels down the style and fertilizes the ovary, which develops into a kernel of corn at the other end of that strand of corn silk.
If all ovaries have been fertilized, the ear of corn is completely filled out with kernels. If there are a few kernels missing or they are poorly formed, those ovaries were not fertilized or were aborted during development.