Most plants have a flowering cycle, but it's only a small part of their entire life. The need to procreate and make babies is an all important feature of plants, but they need to be mature enough for that to happen.
Almost all plants have some kind of flower, but many of them are strictly grown (by us) to have either beautiful flowers, or are scented.
These traits have been enhanced by breeding the best to the best, to finally end up with gorgeous garden flowers that flower for a long time, or repeat bloom, and then die off cleanly.
Flowering plants have a life cycle that is geared towards one thing only; to make seeds.
That's the whole point of their life, and everything they do is aimed at that one thing.
The timing of their bloom cycle, the type of flowers that will attract the specific pollinator to them, the time of day that they open and the number of flowers and how they're arranged all have an impact.
For this all important event to take place, temperature and day length also play a part.
These are what triggers the actual blooming to take place - or even to set buds so they're ready to go at the right time.
Generally, the plant will grow vegetatively for a while, to get some stores in its tissues.
Then the flowering cycle is triggered, by one or more of the factors listed above, either a certain degree of temperature for a certain amount of time, or the days getting longer as we approach the summer solstice towards the end of June (in the northern hemisphere, anyway).
In some plants, the cycle is spread over two or more seasons.
These are known as 'biennials' or 'perennials' based on how long they live. Once they've set seed, they'll die off. Sometimes you can prolong their life by 'dead heading' or removing the dying flowers, which will get them blooming again.