Crop Rotation is an important part of making sure that you look after your soil. If you soil is no good then neither will your plants.
The basic idea is to put veggies in soil that best suits them. Heavy feeding plants (plants that produce large fruits or have large leaves) need richer soil than plants that don’t. So when you finish up with a crop of heavy feeders, you need to either pick a plant that is suited to than depleted soil OR put a plant into the soil that puts nutrients back in.
Rotating crops like this also reduces the chances of your plants being attacked by diseases/insects. If plant A is attacked by disease B, and disease B is prevalent in a part of your garden, then crop rotation helps. If plant A isn’t there to attack or be fed on (because you have put it some place else), then disease B isn’t able to survive.
I always plant carrots after potatoes, to the point where I now only plant potatoes in soil in order to get a carrot crop.