Cooking the mushrooms first allows them to brown properly, which brings out their flavor. Adding them back in later ensures they maintain their texture and don't become too soft.