Writers tend to come in one of three types: Plotters, Pantsers, and Hybrids. The terms basically are how they approach their writing. Plotters plot. They have outlines, character notes, details, and all that stuff before they write a single word of their story. Pantsers go 'by the seat of their pants' and improv a whole lot. They make things up as they go along, and let the story sort of naturally create and resolve itself. Hybrids are somewhere in the middle (where most people really are.)
Neither way is wrong. both have strengths. Pants approach normally leads to more realized characters and action chains that feel believable because the story is developing as it goes so instead of "character A goes to Location X and does Action Y which leads to Result B" you have "Character A is in Situation Z, what do they do?"
Plotters on the other hand can have characters that feel like they're slaves to the plot, but tends to have tighter story lines that fully deliver on what is promised as it is planned from the beginning.
How does this apply to RPGs? Well, there is a lot in common with writing and GMing. Both involve world building, character development, plots, and telling stories. The question then is which camp do you fall into? Are you more of a plotter or a pantser?
Most GMs - especially the good ones - tend to be a bit of both. You can't sell a world and have coherent stories in an RPG without plotting. You need to know the NPCs. You need to know what the story is. You need to know how it could impact things. All of this involves plotting. Yes, you can do it via pantsing, but it is a lot harder to do over multiple sessions. Especially since you won't be the same you when you start a plot vs. when you end one.
However, you can't be a full on plotter as a GM. At least, not without your game suffering. If you plot everything out and how it works and how it works out, you leave no room for the PCs to act. At this point your PCs become more spectators than actors in the story going on. And believe me, you can not plan enough to cover for everything a group of PCs may do.
Because of this, in my opinion, you need to be comfortable with both as a GM. You need to plot to have things ready to go. You need to pants to make room for the PCs to shake things up and impact how they play out. How much of each will depend on your group.