Each type of vegetable or plant has certain nutrient and feeding requirements. There are heavy feeders, light feeders and there are crops that add nutrients back to the soil. Plant species are also usually susceptible to the same types of pests and diseases. Crop rotation puts a different crop in the bed following the one before it so we can limit the amount of compost we add to the soil and break pest and disease cycles.
There is a method to this by planting fruiting plants first (heavy feeders), ie. the plants we eat and value the fruit such as tomatoes, broccoli etc, followed by roots and then leguminous plants (light feeders) that then feed the bed. Continue the cycle of heavy feeders, light feeders, legumes, feed bed with compost. It is hard to follow this strictly though do your best not to plant the same family of crops after each other. Check out the chart below for more clarity.