It works through Google AdSense. You just get paid a fraction of a cent for views and a bit more if someone clicks on your ad. You have to have like $100 worth before you can withdraw it.
I started putting the ads on my YouTube channel for a while now. I just post a few videos whenever I head out to the local racetrack. I've gotten about 40,500 views and almost 100 clicks on ads so far. It's been since August 2008 and I've only gotten $60 so far. That should put the money aspect in perspective.
$60 isn't much, but for 40,000 views and people like Ray William Johnson getting millions of views per video, it can be quite profitable if you get popular.