What makes a story great?
Is it the technical quality of the writing? Sometimes, if it is particulary grabbing (like Joe Abercrombie) but good writing is like the cherry on top. Bad writing is like bad breath on an otherwise attractive person. It can add or detract, but a story can be great with writing that is "good enough".
Is it the storyline? Definitely important. Good plot twists and well paced drama is critical. This isn't the end-all-be-all either though. Low budget films often have good storylines, but fall short because of poor technical execution.
A good bad guy? A definite requirement!
Good guys we can relate to? Another critical element! We need to feel for them. We need to be able to indentify with them. They need to be changed in some way by the dramatic elements of the story, unless their rigid inflexibility is what the story is about.
A touch of humor now and then? Doesn't hurt.
Good pacing? Makes the reader enjoy the ride more.
What's the point of my musing? There is no single thing to master in order to write a great book and some do certain parts better than others. I don't know if anyone gets all elements perfect.
So, writing is more like cooking. There is a recipe. All of the elements are important in some degree. Improve your understanding and your ability in each element and watch the quality of your stories grow!