If so, how? Intuitively, it would seem like being skilled in one automatically entails being skilled in the other. Why is that not necessarily the case?
I'm talking in a purely theoretical manner: what will I say is not backed up by direct experience
Well, in theory, the skillsets you need to be a good editor and a good writer don't overlap completely.
A good writer may be able to set up interesting stories, compelling characters, and amazing plot arcs. But it doesn't necessary knows precisely what he's doing; all the more so if he's made an habit out of writing. He may know what works and what doesn't instinctively, but doesn't always mean he can put that knowledge into words - hence being able to give relevant suggestions to others.
Also, a writer skillset may be limited to the genre he's used to write, to his particular style and vocabulary, and to the books he uses to read most, and so on. While editors may specialize as well on a given genre, they need at least to be more flexible and deal with different PoVs, narration styles, story paces and so on.
So, a good writer could be a bad editor because he doesn't know how to give relevant suggestions to another writer, either because he can't express them, or maybe because he can't "bend" his style to match the fellow writer style.
Conversely, a good editor may have all the skills needed to take a raw story and polish it out until perfection (or guide the writer to do so). But doesn't necessarily mean that he has the ideas and the drive to write one himself. Putting words on page is actually different from editing those same words, a little bit how knowing how a cake is made (the ingredients and the cooking process) is actually different from baking the actual cake.
A good editor could be a bad writer just because he doesn't manage to be a writer (not completing a story, for example) or because he lacks some extent of creativity, and his stories feel like a run-of-the-mill plot, with stereotypical characters and what else.
Sure, editors should be very good at the technical nitty-gritty of writing, spelling, punctuation, sentence structure. That does not make them any good at writing anything original or interesting. In fact most of the people I know who are really good editors are actively bad writers; they know all the technicalities but they can't see past them to create new and interesting content.
What we call a "good writer" is usually a combination of someone who is good at writing and someone who is good at editing. But they are actually very different skillsets demanding very different temperaments and approaches. That's part of what makes good writing difficult.
Being good at writing involves creativity, originality, courage, commitment to self-expression, the ability to visualize things vividly and translate those sensations to paper, and a love of characters, dialogue & description. Being good at editing involves being detail-oriented, ruthless, meticulous, structure-oriented, familiar with conventions, committed to excellence, and technically advanced. The writer mines the gem, the editor cuts and polishes it.
The difficulty is that your inner editor can often get in the way of your inner writer. You often can't write at all if you are constantly self-editing as you go. But on the other hand, an unedited piece of writing is often sloppy, bloated, self-indulgent and tedious.