Both concepts are the same – or at least that’s how everyone does it. Bloggers get paid by various means, the primary of which is affiliate marketing. It is why you see product links everywhere on a blog post and ads as well.
If we get down to the details, blogging needs affiliate marketing while affiliate marketing doesn’t need blogging. So you can say affiliate marketing is better in that regard and more lucrative as a result.