I look at this differently.
I fill two roles. One is creative. One is administrative.
For the creative role I am inserting elements into my game. I am designing an NPC, a location, a spell, an encounter, etc... I try to do creative elements early so they are proactive, and not reactive. I am trying to create things that will then be handled by my second administrative role. When I do this role I am creating elements that will play a role in fun challenges the PCs may encounter. I'm an architect of the game.
The administrative role takes a creation and attempts to unbiasedly implement the concept envisioned by using the rules and motivations of the creations themselves. It is not worried about what the PCs and players want - that concern was addressed during creation. I'm trying to be an impartial and fair tule that implements the world as written. This role just goes with the flow and implements what is created. I'm the contractor following the plans. The odd thing is that this 'less creative' administration is often the source of the greatest innovations in my game ... but the innovations come from how the PCs interact with the established elements of the game and redirect the narrative by making it theirs.
You might ask why isn't the administrative role concerned with the fun of the players? Because if we unfairly help or hurt players through the administration of the game, you take the player role out of the game. If the PCs have a string of bad luck and the monsters decide to take it easy on them ... the PCs were never at risk. They were going to win regardless of what they did. All that die rolling ... all the decisions they made ... none of it matters. You're just playing a game by yourself as a DM and making the players a captive audience. This is a phenomena I call DMasturbation ... you're really just playing with yourself.
No DM can perfectly implement these approaches. You've need to be creative in the moment, at times, when players do the unexpected. You'll need to make administrative decisions with no real concrete rules, motivations or tools established ... which means needing to select something based either on pure luck ... or perhaps taking an opportunity to make the story better in the moment by taking something that should have been administrative and reactive and instead making it creative. We do not always hit the target ... but these approaches are the targets I use and they serve me well.