As a game of chess progresses from one of incomprehensibly vast complexity (with a great many useful moves open to many pieces) to manageable complexity (with fewer useful moves), play transitions from (hopefully) skillful (conscious or subconscious/intuitive) applications of
heuristics, probabilities, and targeted but incomplete analysis (often small differential analysis from remembered/studied games), to
exhaustive analysis of the relevant paths the game may still take (again, often differential analysis from reference games).
The players themselves - and human observers - may not be able to reliably identify this transition, as they'll be prone to feel like they're in stage 2 a little early - while there are still one or more potential plays that could upset their plans. And a careless move may transition a player back to stage 1.
There's definitely skill involved in both stages: in as much as skill is "the ability to do something well; expertise" (OED) - and many reasonable criteria for "doing [chess] well" are possible, such as say:
one's ability to find "better" or avoid subtly "worse" moves, whether in stage "1" or "2" above, and where
"better" and "worse" are evaluated by the impact those moves have on the outcomes of games they and/or other players have after those moves, all compared to others in the chess-playing community.
(I phrase it in terms of individual moves and not "wins"/"loses averted" because in any activity someone may have skill but not consistency; they may not be a great competitor e.g. if they're feeble of concentration, flustered by pressure, unable or even uninterested in manifesting their ability consistently in competitive settings; they might just like analysing complex end games for example, but be very good at it...).
In stage 1, there's also an element of luck: there's at least the potential for:
some reasonable-seeming move to turn out poorly (which would be unusual and therefore reasonably deemed "unlucky" if the heuristics and partial reasoning were overwhelmingly sound and skillfully applied - i.e. of a high standard compared to the chess community overall), or
a great opportunity that wasn't deliberately set up to become available, or
a relatively careless move to have consequences that weren't foreseen, which might work out very well or very poorly.
But, if one player has a lot more skill than the other player, the frequency and severity of significantly "unlucky" moves they might make, or "lucky" moves their opponent might make that they hadn't foreseen and protected against, decreases, until it becomes astronomically unlikely for enough consecutive "(un)lucky events" to have more bearing on the outcome of the game than the skill differential does.
On the other hand, the closer the skill level the more likely that "luck" will be the deciding factor. Here, "luck" might be occasioned by conscious awareness that a choice between moves is being made arbitrarily, or it could be an intuition/hunch to choose between moves that in this case isn't actually usefully informed by any experience or subconscious analysis. There's even a degree of luck in whether a player making an arbitrary choice between what might in some absolute sense be equally good moves happens to choose a move leading to a situation their opponent is more or less skillful at handling (e.g. because their experience and study is more relevant to one position than another).
You could compare this tide-of-skill versus spontaneous-fluke factor to say tennis: a lucky outcome could see me win a point against Roger Federer - perhaps by playing a very low percentage but skillful shot that happens to work out that one time, or even by having a shot hit the net-cord and drop over, come off my racquet frame at an unlikely but advantageous angle, or bounce strangely for Roger. But, the chance I'd win an entire game is maybe 0.1% (?), a set would be like winning lotto twice in a row, and a match - well, the universe might end first. (Sane caveats re Roger being mentally/physically fine etc..)
The more a game requires a great many moves to shape and turn the outcome, and the lower the chance for a fluke beyond either players' control, the more predictable the outcomes are, and the more the skill differential ensures the outcome, even if that skill is probabilistic and not deterministic. Skill is a huge factor in chess, but skill is not a constant for a player - they may be more skillful at handling play from certain positions than others (perhaps they just read a book on a relevant tactic), and occasionally a player of lower average skill might prevail based on some particularly relevant but limited skill (and be deemed lucky that play led to a situation where they could apply it). In close matches, and perhaps in beginner's matches where more of the movements are made arbitrarily without even a guiding strategy or heuristic used, luck starts to play a significant role.
I think it's interesting to compare this to baseball, I read a book about it years ago that explained how some Wall Street quant types crunched the maths and found that the worst team in the top league had something like half the chance of being the champions that the best team had... i.e. surprisingly little impact on odds came from achievable differences in skill (given the top team had vastly more budget to hire players considered "stars"). For example, while the percentage of swings that made contact varied with batter, the out/1st-base/2nd-base/3rd-base/home outcomes were in similar proportions: you might observe that it took skill to hit the ball more often, but doing so was so difficult and the angle of contact so uncontrollable that what happened when you did basically came down to luck. Overall, luck could easily swing a game.
Separately, and this may be controversial and I'm not claiming it's true - just reasoning about the implications if it happens to be true: I saw a study report that when chess grandmasters played good club players, starting at random board positions that would not occur during actual games: the grandmasters lost their main advantage as they didn't have a huge wealth of applicable reference games with which to compare; reduced to actual logical reasoning without any particular advantage - they only had a smidge more than 50/50 chance of a win. Does that mean chess is less about skill than my above assertions imply? Is a vast memory of games itself a skill? I'd say so - it clearly allows you to "do well" in non-random games, and that's all the OED requires. Further, consider say a language translator - we'd consider the size of their vocabulary to be an aspect of their skill level.