The real question is why the use of garden soil is not recommended in pots. Garden soil has a host of life forms within it, including bacteria, pathogens, fungi and various microfauna. All of this is more or less kept in balance in open ground, but if you dig some up and put it in a pot, its possible it will contain pathogens - those pathogens, whilst harmless in open ground, will not be so contained in a pot. There may also be issues with poor drainage with many garden soils. However, many people do just use garden soil, and the plants growing in it are okay, but there's a risk it won't be. That is one reason why sterilised potting soils are used.
Most potting soils are created from composted materials - it's processed aerobically, so the contents are naturally sterilised by the heat generated in this process. Even so, there is plenty of humus rich material within it, which is great for plants. Other things can be added to potting mixes, such as sterilised loam, perlite, peat, fertilizer and so on, depending on the intended use of the particular potting soil. Seed and cutting potting soil has much less or no fertilizer within it, so that's one formulation; there are other specialist formulations for bonsai, orchids, ericaceous mix for acid loving plants, houseplants, and so on. There are also the general use potting soils (called potting compost here) - in the UK, these are known as multi purpose, but we also have John Innes, which comes in three grades or 'strengths'. Formulation of JI varies between 1, 2 and 3 in terms of ratio of loam to peat to other ingredients, including more or less fertilizer. The king of potting soils, John Innes, but not available in the USA so far as I'm aware.
If you are starting growing in pots or containers from scratch, then its better to invest in the best potting soil you can find that's appropriate for what you'll be growing, rather than attempting to sterilise ordinary soil and then working out what you need to put back in to make it a useful growing medium.
This question and answers here might be helpful Why use potting mix instead of natural soil?