When it is the roof, the usual entry points are flashing failures, pipe boots, nail pops, and ice dam backup at the eaves. Water then travels along the deck or a rafter and drips off at a low point — which is why the stain is often nowhere near the hole.
When it's condensation, the cause is warm, humid indoor air reaching a cold attic: bathroom fans vented into the attic instead of outside, unsealed attic hatches, and recessed lights leaking air. In an Illinois January, that moisture frosts on the cold deck and rains down during the next thaw.