It's genuinely kind of fascinating to me that the Prime Directive was, as far as I recall, never once mentioned or alluded to for over 20 episodes of TOS and is rarely that big of a deal. Sure, the world-building developed gradually over time and it takes a bit to find their footing, but you really wouldn't guess from TNG and general Star Trek discourse that the Prime Directive is so completely irrelevant for so long.
But also, the very episode in which it's introduced—"Return of the Archons"—parallels the Prime Directive of Starfleet with the Prime Directive of the evil computer in the episode. The familiar Prime Directive is only mentioned once in vague terms; Spock brings it up as a concern and Kirk immediately rule-lawyers his way out of obeying it. Meanwhile, Landru the evil computer (named after an actual, long-dead guy who programmed it) says:
Your statement is irrelevant. You will be obliterated. The good of the Body is the Prime Directive.
Landru has basically instituted a terrifying control state in which people are kept submissive, docile, harmonious, and physically healthy, interpreting this as "the good of the Body" (the body being the physical welfare of the people). It's able to override the wills of those subsumed into "the Body," including Sulu and McCoy.
Kirk, aided by Spock, beats Landru by focusing the analysis on "the good" and thus redefining the Prime Directive (of Landru) as creating the good for the people and destroying the evil. He then convinces Landru that Landru's oppressive rule itself qualifies as "the evil" and thus it must destroy itself under the Prime Directive.
KIRK: You are the evil. The evil must be destroyed. Fulfill the Prime Directive. You—
LANDRU: Landru, help me!
KIRK: —are the evil. Fulfill the Prime Directive.
So, the very episode that introduces the Prime Directive as a concept:
Is over 20 episodes into the series;
Barely mentions the Starfleet version, and the Starfleet characters easily come up with a justification for ignoring theirs in favor of helping people;
Provides an obvious dramatic foil in the evil AI counterpart version, also called the Prime Directive, and what often is the thing being referring to by the term in that episode;
Has Kirk et al free people by redefining the evil Prime Directive as requiring the promotion of the common good but for real, and destroying the true evil of oppression, resulting in the liberation of the people Landru was dominating.
The takeaway about Starfleet's Prime Directive in the context of all this is ambiguous at best. So the Prime Directive becoming this very concrete, pivotal, absolutist aspect of the world-building is not really how it's introduced. And I do feel like TOS most often treats "fight oppressive evildoers and help people" as a far higher priority than non-interference, though Kirk et al do prefer to accommodate regulations and orders when they can.
It reminds me a little of Asimov's Three Laws of Robotics, which were an intriguing concept to begin with and became this whole ... thing over time.