The flower is already formed inside the bulb. Looking at a photo of a tulip in its early stages gives a clue, as you can see the flower head poking out of the ground intact, drawing its energy from carbohydrates in the fleshy surrounding layers. As the bulb grows, the leaves, exposed to sunlight, photosynthesise replenishing its food stores. This is why it's important to continue taking care of bulbs after the flower has died but while the leaves are still green if you want to recycle bulbs next year or leave them to naturalise.
Growing bulbs is foolproof, it's what I would recommend to a novice to provide them with guaranteed results which would encourage them to seek further challenges in the garden. I've heard people lament about underground slugs boring into their bulbs. I haven't experienced this yet even though I don't use slug pellets. I just hope that by planting so many bulbs, I haven't turned my garden into a haven for these pests. I have countless regular slugs and snails which eat leaves but so far this hasn't interfered with flowering. I do have problems with foxes digging up my bulbs and leaving deposits on my spring flower beds. Covering with netting till the leaves show helps.