A natural part of the plant life cycle
Some biennial or perennial crops will naturally produce a seed stalk during the growing season, which will not interfere with crop harvest (e.g. rhubarb, onion, and hard-neck garlic). In each case, removal of the flower stalk when it appears will redirect the plant's energy into edible parts of those plants.
Bolting
Biennial vegetable crops complete their life cycle in 2 years. But many will produce flower stalks in response to cool or hot temperatures and long days. This is a common occurrence in spinach, lettuce, carrot, and members of the family Brassicaceae (broccoli, cauliflower, cabbage, etc). Other members of this family grown for their leafy greens (e.g. broccoli raab) will "bolt" with increasing temperature and day length. "Bolting" or premature seed stalk formation often prevents the gardener from harvesting a usable crop.
Tips on managing "bolting": Many mid-Atlantic gardeners get more consistent yields with fall-grown broccoli and cauliflower (decreasing day length) as compared to spring-grown. Sow seeds in late July for a fall crop in Central Maryland. Avoid purchasing or planting overly mature, stressed transplants. These are more likely to flower prematurely. Certain crops, like lettuce, coriander, and broccoli raab, should only be grown during the cool spring and fall months. Close plant spacing can encourage bolting.
The early appearance of seeds stalks in a planting of rhubarb may due to the particular variety, hot spring conditions, poor site conditions (hot, dry, full-sun), or a sign that the plants need to be divided. Seed-propagated rhubarb is more likely to produce premature seed stalks than those that are vegetatively propagated. If your rhubarb consistently produces seeds stalks and few usable petioles you should replace the plant with a better cultivar and/or move the plant to a more suitable location. Rhubarb is grown with varying success in states below Pennsylvania.
Onion-biennial seed stalks form if weather is cool early in its growth cycle.