When a plant produces an unwanted flower head immediately before dieing.
Many vegetable and herb plants are grown for their leaves or bulbs. Often they will die shortly after producing a flower head and seeds. The process of putting out this final flower head is known as bolting. Ideally these plants should be grown for as long as possible before this happens. Example plants that can bolt include basil and onions.
Usually bolting is caused by poor growing conditions (eg. too dry or too hot). The plant senses that it is going to die, and in one "last gasp" produces a flower so that its genes will survive to the next generation.
Use this tag for questions about how to avoid bolting in specific plants. bolting is a common problem with specific plants, so the chances are your question has already been asked: Be sure to search the site first before asking a potentially duplicate question.