The simplest way to distinguish between compost and fertilizer is to remember this: Compost feeds the soil and fertilizer feeds the plants.
Fertilizer adds to the soil’s nutrient supply, but instead of feeding the soil food web, the ingredients in fertilizers are intended to meet the needs of fast-growing plants. While recommended amounts of compost can be quite general, fertilizer application rates are based on the needs of plants. Either organic or conventional fertilizers work well for vegetables, but organic fertilizers have been shown to be friendlier to the soil food web. Chemical fertilizer can also feed composting, but continual use may throw soil chemistry out of balance and discourage microbes. See fertilizer to explore your fertilizer options.
Compost and organic fertilizers can work together. The organic matter in compost sponges up the fertilizer nutrients until they are needed by plants. Compost also provides many nutrients that plants need in small amounts, such as boron. You can use fertilizer without compost, but why miss an opportunity to increase your soil’s fertility and its ability to hold moisture? Soil that is regularly amended (i.e., improved) with compost becomes wonderfully dark and crumbly and often requires much less fertilizer compared to soil that has not yet benefited from regular helpings of compost.