Basically there are 2 ways:
Selling- Sites like ebay or amazon make money by selling products, that's where their revenue comes from, in the case of ebay it's just an intermediate but all the people involved with those websites or the website itself makes money by selling, the Internet simply works as a way of getting your good or service by a wider range of people.
Adds- Many websites have adds, it works in the same way as real world adds, a person or companies pays to have their adds featured in a space, in this case cybernetic space. The publisher gets payed in case the person clicks on the add or by the number of views, adds can come in many different ways, but the goal is always to get another entity noticed either than the publisher,
In this field there are also affiliate programs, a companie pays the publisher to sell their product, that publisher gets paid by commission on the sale.
It looks simples but the cybernetic consumer is very suspicious and is almost always afraid to click on anything and buying is almost always out of the question, the only way you can make any money is by having a great amount of traffic and that comes from quality, it doesn't mather which adds you place it's gonna come down to that.
It's not impossible, it's just a constant struggle, most people can't survive on an Internet business, so if you want to do something be genuine, do what you want, because if you get in for pleasure the passion will get you through the day, not the money.