Well there can be many ways:
1. Paid hosting option- free hosting is funded by the receipts of paid hosting that is also offered by the hosting company simultaneously .
2. Post2host - free hosting is funded by ads placed on host's forums . Host is paid based on views and clicks by its users on forum ads . Also since post2host helps hosts generate good quality content, advertisers may pay more to have their advertisements on such sites .
3. Upgrade option- free hosting is funded by users themselves . Hosting features are strategically kept really low to force users to upgrade to paid. This is what funds the hosting
4. Surveys- free hosting is funded by surveys they are forced to complete
5. Partnership- free hosting is powered by partner companies or affiliate companies which fund the hosting or provide hosting resources to them in return for a share or for links or ads on hosting company or for the users that hosting company sends to them
6. Sponsorship- free hosting is sponsored by some other companies or individuals which offer free services or resources or financial backing to the hosting company.
7. Own Pockets- free hosting sometimes is funded entirely by the hosting owner himself . He gets the satisfaction of having done a good deed . Only very rich persons can afford to do this . Very rarely you'll find such hosting companies
8. Donations- free hosting is powered by donations that host recieves from it's users
9. Odd jobs- free hosting is powered by other companies or individuals for whom the hosting owner does odd jobs like web design or forum moderation or some other means . You need a super skilled , super dedicated and super work-o-holic admin to have such a host running .
10. Mix of two or more of the above .
There may be many others too, but these are all that I can recollect at the moment...