The point of a PhD is really simple...It's to prove that you can conduct research on a professional academic level.
Ok, so you're supposed to contribute something too, but that's just how they test that you're capable.
So you set about your project probably not really knowing what you're doing.
Then you realise how hard it is, as you run into more and more problems.
But gradually you solve them. You find better ways of doing things, faster ways, easier ways. And when you've solved a problem once, it's much faster next time it crops up.
After a few years, you're a much better researcher than you were at the start, and all those problems you solved add up to a detailed and unique practical experience. First year students come to you for advice and you can instantly see what they've done wrong. To you, it's just because you made the same mistake years ago. To them, you seem like a wizard.