As the developing plant grows, the fungus grows with it. Once it's time for the flowers to form, teliospores are produced in place of the flowers and develop where the grain would be.
During the growth of the developing plant, the fungus proliferates alongside it. Once the flowers have matured, teliospores replace them and develop in the location where the grain would normally form.