The main function of the stamen is to produce the pollen grains, which house male gametes, or sex cells, necessary for reproduction. The anther is located within the stamen where these gametes are created. Pollen grains vary in size, shape, and surface structures based on the type of flower that produces them.