The difference of skill and luck is something that is important to understand and differentiate, specially when the markets are making a new high. Like in every sphere of life, luck plays a very important role in the markets. Some may call it by another name - fortune, chance, God's grace etc. Ultimately, it is a matter of probability playing out.
So, how do we differentiate between luck, skill and luck disguised as luck? I use Charlie Munger's concept of inverting the problem. Is there a way to conclusively fail in an endeavour? If so, then we can say that the component of luck is minimal and skill is inherent in that work. For example, if say Djokovic wants to lose a match, can he do so? The answer to that question is, maybe, but we cannot say for sure. His opponent can play worse or get injured and Djokovic still end of winning. So, there is some element of luck in tennis. On the other hand, let's look at a potter. How easy can he make a crooked pot? The answer is easily. So, his job has a high degree of skill.
Can you think about investing in markets? Can you ensure your stock picks will fail? I can't. I might buy the worst possible stock which I think will surely go down and it may rally.
The reason I am writing this now is that markets are rallying, making highs and a lot of people will see their portfolios and picks do really well. They will start thinking that they are great stock pickers. This is the time to be cautious. Follow a good and sensible process and try to understand the role of luck in your gains. That will hopefully keep you grounded.
Happy investing.