By preventing the production of seed, the plant is allowed to put more resources into root and foliage growth, as well as the production of flowers. In the case of some annuals, seed formation can mean a rapid demise of the plant, so energy that would go into seed formation is used instead for more flower production. Perennial plants that are deadheaded before seed production will use the energy towards the development of next year's flowers. There are some occasions when deadheading may not be recommended. Some plants produce fruit that is attractive.
Fruit is the part of the plant that carries the seeds.
A good example of a plant that is grown specifically for its seed production is the money plant. This plant's seedpods are used in ornamental arrangements. Another reason to avoid deadheading is if you plan to collect seeds for propagation, or if you want a particular plant to self sow in your garden. Bachelor buttons is an annual that self sows readily. Many gardeners will remove some of the flowers to encourage repeat blooming but also will allow some flowers to produce seed to sow in the garden for the next spring.