Moisture moves from humid zones to dry. In the winter in cold climates that means from the inside to the outside. When it reaches its dew point temperature it condenses on any available surface. That could be inside a wall cavity or your roof. Through stack effect, warm moist air is pulled into the attic and if it hits a cold surface it will condense. Mold will grow anytime two conditions are met: moisture and an organic material. That’s why attics are vented, to prevent just those condition. But that also means all the hot air is being lost to the outside.