In general, female flowers absorb pollen, while male ones produce it. A multitude of plants (including corn and squash) are known as monoecious, meaning they possess flowers of both types.
The male flower of the plant produces the pollen needed to fertilize the female parts further down the stalk. This process will eventually develop the cobs of corn that you enjoy eating.