Poker, though, is actually almost always profitable in the long run for the player who makes consistently better decisions. It's very possible to make a long-term profit playing poker in casinos, especially because there are so many tourists who are just blatantly bad and have no idea that poker is anything more than random gambling (just like all the other games in the casino.)
The tourists are the most profitable opponents
The key difference about poker is that it's the only casino game where you play against other players, NOT against the house. The house makes its profit here by simply taxing a small percentage of every pot played, perhaps 5%. This is called the rake, and it means that, in order for you to turn a long-term profit, your skill advantage over the other players must be big enough that you average more than a 5% return on your overall investment against them, but that's quite possible against bad opponents.
Online poker works exactly the same way--the casino/website doesn't care who wins as long as the money keeps moving around, but the best players have a big enough statistical edge through skill that they turn a consistent long-term profit anyway.