Even the most novice green thumb knows that a high-quality soil creates an abundance of blooms or veggies. Whether purchasing a commercial soil or making a mix of your own, always use soil prepared for containers in anything other than a garden bed. Nutrients can be easily depleted--plus disease and pests can be spread--in old potting soil, so use new soil each growing season or each time you change containers.
Container-grown plants have no other competition for the nitrogen in the soil. A key component in the formation of chlorophyll, nitrogen is the most abundant nutrient used by plants to grow larger and green. Nitrogen is used quickly and plants needing more nitrogen will show stress by yellowing leaves. A shot of a nitrogen-rich fertilizer or spread compost will produce healthy results. Avoid too much nitrogen for most vegetable plants such as tomatoes, though, as this will result in huge plants that won't produce fruit.
Potassium provides all living things with the building blocks for cell development. Sometimes referred to as "potash" in potting soil ingredients, potassium is used by plants for healthy stalks and leaves. Potassium is used less frequently than nitrogen and seldom needs to be replenished outside of a normal dose of weekly fertilizing.
Phosphorus is needed for seed production and healthy root growth. While not as vital to growing annuals, phosphorus-rich fertilizers (usually marketed as "vegetable garden" fertilizers) are important for growing veggies and fruits.
There are a number of other lesser-important minerals in potting soil that are used by growing plants. Usually a mixture of peat moss, compost and drainage helpers such as vermiculite, potting soil mimics the most ideal garden soil conditions possible. Compost helps give the soil composition and provides many of the above-mentioned nutrients as well as trace minerals such as magnesium, calcium, sulfur and carbon, all needed in small doses.