I've been researching fans and the ones I've found all seem to vent to the attic. Why is that? Why can't they vent directly to the outside? It seems more efficient that way. Otherwise you have to have anothe fan to vent the air in the attic.
As was said in the comments on your question, you get additional efficiency by clearing hot air in the attic in the process. Your house air is maybe 75-80* F, while your attic can be 100* or more. Ventilating the home and the attic results in greater overall cooling by reducing heat that would conduct back through any attic insulation.
I assume here that whole-house ventilation is used exclusively for cooling, and that we're not discussing heat recovery ventilators (HRVs), which are typically only used for bath and kitchen ventilation and are installed according to strict protocols, which wouldn't allow attic discharge.
There are three reasons why whole house fans generally vent into attics. First, whole house fans are designed to pull air from the highest point in the living space of a house, which is generally where the warmest air collects. This removed air is replaced by cool air entering windows in the first floor, flushing the warm air out of the house. The highest point is generally the ceiling of the top floor, so the obvious route for the air is at least into the attic. However, whole house fans are designed to handle large amounts of air, so it's better to vent the fan into the attic rather than directly out an enormous vent in the roof or gables.
Second, the attic is often the low-rent district of the house, which makes it a good location for the fan mechanism itself.
The third reason was raised in another answer: cooling the attic will reduce the heat load on the main house. However, a properly insulated house (at least in non-tropical climes) will have enough insulation between the top floor ceiling and the attic itself that it won't matter much what the attic temperature is; the heat won't have much of an effect on the floors below. Still, there is some benefit to having a cooler attic.
Add all this together, and you find the majority of whole-house fans will vent into the attic, with the attic in turn vented to the outside by any of a wide variety of (generally passive) methods.
Depending on your climate, venting a bathroom or other house fan to the attic is a very bad idea. If you live in a cold climate (outside temp lower than room temp), the colder attic will cause condensation of the warm moist home air or even freezing of the water vapour in the attic, potentially leading to mould or rot of the wood, or ice in the attic insulation. These are all undesirable.
Vent any house fan directly to the outside. This is usually done with a flex duct run from the fan outlet, through the wall or ceiling to a vent cover on an outside wall (not through the roof, unless you install a fan roof vent specifically designed for this purpose).
The attic should be properly vented on it's own with soffit vents on the bottoms and ridge or roof vents near the top, and not rely on house fans to motivate air flow in the attic.