The ads that pop up go a small way, but by no means anywhere near the cost of running the forum. The content of the actual ads themselves are mainly driven by your own internet browsing patterns, because big brother is watching everywhere you go these days, and your computer will be full of tracking cookies. Therefore the ads an individual sees will be different to the ads the next person sees. On the other hand, if Google can't quite make you out, or if they can't throw an ad at you that matches your browsing pattern, it will often be a generic one such as dating sites and so on - unless you routinely browse dating sites of course, in which case, well, you'll get dating site adverts.
The ads are a part of the forum software, but you can tame them to a certain extent by obtaining and regularly using some good anti-malware software, which amongst other things will identify and remove the tracking cookies on your computer.