baking is one way of dealing with pests, not the only way, commercial greenhouses use this method(or steaming) to control pests
when i say bake, it's a very light bake, 200F isn't enough to boil water
soil is a living thing, baking it hard will kill it, and that's not so nice for growing
when you bring in an outside soil, you bring in pests that no longer have the natural controls of the outside, predator insects, etc.
bring that inside and the pest take over, maybe, depends on the soil and how it made, local conditions, and many other things