These two types are often called "Plotters" and "Pantsers", with the idea that the Pantser writes by the "seat of their pants".
One thing that doesn't get talked about much is the concept of a third type of writer, the hybrid writer. They will figure out their book's theme, title, three or five act structure, characters, major plot points, and the ending all ahead of time. But this is just a skeleton, an outline. Like a fractal, it gets fleshed out at the time of writing. Writing proceeds linearly from beginning to end, much like the Pantser. When the novel is finished, there are still editing tasks and possible changes to be done.
I've written all five of my novels using a hybrid approach, and I wouldn't want to change. Every author is different.