A single butterfly can lay 1,000 eggs but only five percent turn into butterflies. Birds, spiders, wasps and other insects eat both eggs and caterpillars. A more serious cause of declining butterfly and other pollinator populations is the use of neonicotinoids. Many plants and seeds have been treated with this chemical that is absorbed by, and remains in, every part of the plant, including the pollen and nectar that feed the pollinators. Neonicotinoids affect the central nervous system of insects, resulting in paralysis and death. So keep this in mind when buying your plants and ask if they are neonicotinoid-free.
Caterpillars eat a tremendous amount before turning into a butterfly so it is nearly more important to plant host plants, as they are called, than flowers although many flowers are also host plants. For a list of host plants and the butterflies that use them go to: https://www.naba.org/chapters/nabanj/Butterfly_Caterpillar_Host_Plants_for_New_Jersey_Gardens.pdf