Polymorphism
So when an insect in search of nectar inserts its proboscis into a long-style flower, the pollen from the stamens stick to the proboscis in exactly the part that will later touch the stigma of the short-styled flower, and vice versa.