I've been playing poker for money for exactly 42 years, and fairly successfully, I might add. I'm not good enough to make a living at the game (more on that later), but I'm certain I've won more than I've lost over the years.
As far as the luck vs. skill factor goes, the old saying applies: "I'd rather be lucky than good".
In the long run, the more skillful player will come out ahead, but the "long run" can be loooooong. Sitting in a game in a casino for 4-5 hours, or even longer, may very well not be long enough to even out the luck factor.
Remember, for professionals -- the best players in the world (and I'm talking about the "grinders", guys who "grind it out" to make a living by playing $10-20, or $15-30, not the high-profile guys you see on TV) -- it's a job, and they may play 40, 50 or 60 hours a week, month after month, year after year, which is enough time for the breaks to even out.
But for the occasional visitor for a day at a casino, luck is far more important.
The above is proven by the rather unfortunate experience which you describe, JB. You don't say what you went all in with, but I assume both card were higher than the 2-7 your opponent held, which makes you the favorite what, 85% of the time?
Play the same hand 100 times, and you'd probably win 75% of the time. But obviously, one hand was not enough to overcome the luck factor. Your opponent may have been a 4-1 underdog, but 4-1 odds aren't really that long.
I would also mention that it's important to make sure that you are not in a game in which you are out of your class.
Poker players tend to move up to higher limit games progressively as they win in lower limit games.
A consistent winner in a $5 limit game is naturally gonna move up to a $10 limit if he consistently wins playing $5 limit. If he wins consistently play $10 limit, he's gonna move up to the next level.
But at some point he's going to reach a level where the other players are better than he is, and he'll start to lose and eventually drop back down to the lower level where he has proven to himself that he can win.
There will be exceptions, of course. Some players will always find themselves in higher limit games that they have no chance to win in (unless they are extremely lucky) simply because the stakes in the lower limit game are not high enough to hold their interest, but generally for the regular players that you find in most casinos, the above is true.
So start off in the lowest limit game that you possibly can, and prove to yourself that you can win consistently at that level. If you can, move up in class, and if you keep winning, keep moving up. But as soon as you find it to be a struggle, drop back down to the level at which you are a proven winner.
That's why, BTW, I'm not a professional poker player. I play seven card stud, and have found that I can win consistently playing $5-10. The trouble is, I can't win enough at that level to make a living, and as soon as I move up to $10-20, a level at which one can make a living if they're good enough, I run into a table full of professionals.
As far as Hold 'Em goes, I consider it a game in which luck is more of a factor than seven card stud.
In low limit games, players tend to be willing to stay for the flop when they can see three cards for the price of one so to speak if there is no raise, so if you have six or seven people hanging around and playing with nothing, anytime you see a pair on board after the flop chances are someone has trips.
It's also very hard to read a hand, since you have no idea what someone has in the hole, so, as JG correctly points out, it's more important to be able to read the player than the cards, which can be very hard to do if you don't know the players you are playing with.
That's why I prefer seven card stud. People tend to play with the same starting hands, and since everyone has different cards on board, it's much easier to read another player's hand.
--------------------
Listen, here's the thing: If you can't spot the sucker in the first half hour at the table, then you are the sucker. -- Mike McDermott, Rounders