LotR *is* kinda subversive and, I bet this is Tolkein's spirituality and military service showing, in that you've got an exciting war against ultimate evil story, but what's equally heroic is a guy thruhiking really hostile territory while facing intense spiritual corruption.
I'd wonder if the narrative purpose of Frodo's encounter with Shelob is to show that he's still competent and brave in the face of an immediate physical threat; it's just he's not in the war story like his friends are.
like... she's literally Ungoliant's daugher. Her mother worked for Sauron's old boss, Melkor, so she's a power level vaguely equivalent to the balrog (defeated by a straight up minor deity). So those two fights are the closest anyone comes to taking Sauron on, in person, throughout LotR. (Yeah Aragorn fires up the Palantir, stares directly at the unblinking Eye and says "hey, you want me, I'm right here," but he's never actually in CQC.)