It must be at least half of the time, when on a home inspection, I find that the bath exhaust fans are directed into the attic space. Sometimes it is pretty obvious from the get go that this is going to be the situation: there are a couple bathrooms and no vent hoods at the roof or the exterior wall.
Other times, the inspector will see vent hoods on the roof but, from the attic view (or by feeling the vent hood with the fan running), it is readily apparent that no air is making it outside. This is usually the result of improperly connecting the duct, simply taping it to the fan outlet or the vent hood. The tape drys out and the fan ends up blowing steam into the attic. This creates prime conditions for fungal growths and mold.
Here is photo of a disconnected bath fan.
Even if there is not presently a vent hood in the roof, this is not so difficult to fix. Have a roofer or another qualified professional repair. If the problem is simply the exhaust fan duct, well it should be held in place with a minimal number of strategically placed sheet metal screws, not duct tape. Although it might be named "duct" tape, in most cases the product is pretty lousy for attaching any ducts together. Use it, instead, to wrap around your tennis shoes when the soles are falling off.