ok writeblr i have a question and it does not matter if you answer re fanfic or original work:
do you nerds know what themes you intend to tackle in longer works before you start, or are the themes a fun little surprise you don't uncover until the nth draft?
Kind of? I usually start out with a scene or a vague idea for a plot, then I flesh out the characters and the world they inhabit because those are kind of important. After that I tend to think about motivations and inciting events, and that's usually where theme comes in.
Just like plot, themes kind of occur to me in the early stages of drafting like when I'm writing garbage scenes to get a feel for the characters and setting - what comes up most often when I'm screwing around in OpenOffice? What questions do I want to answer? What subconscious nonsense wiggles its way into the dialogue and what kind of callbacks do I end up making when I'm messing with a scene from the middle of the book that I'll probably end up trashing before it's all over with?
I end up dissecting behaviors and habits, beliefs and a hundred other things that probably won't stand out to me at first, but then they'll come screaming out of left field while I'm in the middle of chapter 7 and I get to feel like a literary badass for a bit. I also like to ramble at my sister over various chats and barrage her with random ideas for inside jokes and plot points that appeal to me. We're both interested in literature and psychology, so we'll yammer about potential traits and weird habits and try to figure out what in the character's past led to this or that and why they're this particular kind of messed up.
I never set out like "I'm going to write about overcoming racism" because personally I don't think that's something to write a book about - we shouldn't need 100K words about why being racist is stupid but I digress. Instead, I start out like "wouldn't it be fun to write about eight-foot-tall seal aliens with giant dicks and glowy spots? What if they're big into science and ecology?" To me, it's all about the tactile things, the things that happen on screen that you can see with your eyeballs, and weaving theme into it is something to do very subtly. You can't ham-fist theme into everything because then you get a boring thesis paper and nobody wants that.
There's also the idea that art is subjective. We all read the same books in Literary Interpretation, and all 15 of us got something different out of them. Some students were more interested in the concept of being afraid of modernizing, others focused more on how the advent of telegraphy expanded our world and brought humans closer together across great distances. If we'd all been told "here are the themes, write a paper about them" everyone would have turned in the same paper.
So sure, I usually have one or two themes in mind by the time I have a plot nailed down and sometimes that will expand or change completely by the time I finish the story. And then once I release it into the wild like a rehabilitated salmon, it almost always gets interpreted completely differently by some internet person whom I've never met, but that's what makes it fun!