When playing games, the story and mechanics have an interesting relationship. They are linked and the way we interact with the mechanics are part of the story we experience. It is one thing to imagine your character as an awesome fighter, it's another to see them take on 4 skeletons without much trouble. The trouble is that sometimes we can get lost in the mechanics, the what, and forget to go back to the who. I know I'm guilty of this as well. Having been there, I hope my thoughts on the manner will help someone out there.
What vs. Who
For the purposes of this post/article thing, the what part of a character is what the sheet says. What is the character? What class are they? What's their background (mechanically)? What do they carry? The who is a bit more of a nuanced topic. However, a big part of it is “why”? Why do they choose to fight the way they do? Why did they turn out the way they did? There are also more nuanced questions of “what would the character do?” and “what would it take for them to do something?” The answers to these questions help tell us who the character is. If you ever feel that a tug towards an action that doesn't make sense from an optimization standpoint just because it's what your character would do, you probably found it.
Get into a class based RPG system and you'll find yourself needing to choose a class. There are two main ways you can go about doing things here. You can have a character in mind and try to pick the mechanical choices that will make that character a reality. Of course you might not be able to have everything you wanted at level 1, but you can plan ahead for that. You could also take a look at the classes that are there, pick one that looks fun to play, and build a character around that. Both are fine options, and in fact picking the class first can help you get out of your comfort zone, but it does sometimes lead to the situation where we forget to tie it back to who the character is. After getting the class, we still need to go back to the start and thinking about who the character is. Some people can do this during the session and just roll with things as they happen. For the right people, that can work amazingly well, but sooner or later we'll need to consider who our character is.
How Events Influence Character
Over the course of a campaign, characters find themselves in a wide assortment of situations. They will gain and they will lose. All of these situations are potentials for character change and growth. Of course, every combat encounter shouldn't result in massive changes of character (unless you are playing a character with 50 souls in one body), but there will be some that can have an effect on your character going forward. Even if they don't have a long term effect, they can provide interesting ideas to explore in the short term.
Too often, especially with newer players, characters will end the campaign exactly as they started but with much more wealth. Coming with this, they'll approach every situation the same way. When you find yourself in a new situation and keep your character in mind, you may be surprised what you might learn about them. Or how the character seems to come to life and has a will of its own. Those moments of inspiration are magic and honestly one of my favourite parts playing tabletop role-playing games. You can't think of every situation for your character going into a campaign (and even if you could, it would ruin some of the fun), so those kinds of situations are important to building who your player is.
Magic items are an often missed chance for players to consider who their characters are. They are a way to do the previously impossible and a source of great power. How do they handle that? How far will they go for it? Is what they have enough? Especially in games that deal with themes of power, these questions can lead to many interesting role-playing opportunities. This is without even going into sentient magic items. Having someone to interact with so close and at the ready is an interesting situation. A classic situation is to have a magic item you vehemently disagree with and force to do what you think is right. However, even if you see eye-to-pommel with your magic item most of the time, there could be edge-cases where that is no longer true.
We are in a bit of a different position than players when it comes to characters. A player typically has one character that they know inside out. They go for depth. As a Dungeon Master we have to go both for depth and breadth. When playing villains we want to know very well who they are. However, with some characters it isn't needed. We can't fully flesh out every character either. We also don't get as much time to test our characters in-game and let them naturally evolve. As a result, I'd argue improvisation is far more important for us. Many of are characters tend to be just a couple sentences with an alignment and a stat block.
Being able to go from a mechanics to a character on the fly is difficult to say the least. For that reason I suggest some level of cheating. I've mentioned before how I like to have lists of names ready to go, as do tons of other Dungeon Masters I've had to the pleasure of playing with, but there are other things we can do as well. Instead of thinking about single characters in large groups of bad guys meant to be thrown away in an encounter, we can think about who the group are. Are they uniform? Do they share some kind of similarity? Why? Those questions tend to be a good start to be ready for improvisation. If we think about the larger story at large, we'll typically need to answer most of these anyway. Even in the case of wandering monsters, we'd need to know why they are there. The goal here is to reduce how much we need to make up on the spot. Now instead of thinking about the whole group, the campaign as a whole (why are they here?) and then the individual, we only need to think of the individual. We even have some names ready to go.
The first step tends to be the hardest because there is the most to consider. After that, we get into the stage where interacting with our players helps fill in the details for our characters. Our characters, again, tend not to be as complete as those of our players. There will be many gaps that need to be filled in to make them a complete character. However, this discovery over the course of the game is important to good improvisation in my opinion. I also find this stage easier since there is less to consider at once. It would be similar to what we would do if we were player playing our character. Remember though, players will get to know characters over time. They won't know everything about them at once. Often we both get to know the characters we create as we play.
We as Dungeon Masters have an idea of what who our players are and who they are playing. It's important to be careful here. We want our ideas of the characters to be at the very least reasonably close to what our players intended. Seeing a wizard, we can have our own ideas that come into play. However, just remembering that we might take our own expectations for player characters tends to be enough to avoid the major pitfalls. We need to know who they are in order to come up with good role-play opportunities, but we have some leeway as well. If we are slightly off, it's just a different role-play opportunity and won't be noticed. The bigger issue is when we get major things about the characters wrong (wrong faction deciding to talk to a certain player) or presuppose character traits. There are ways out of these situations (oh, sorry, I thought you were someone else) but even so, I find keeping these in mind is helpful. I want to provide interesting situations for our players to express and develop their characters. I don't want to shatter their immersion by treating a player character in a way that makes no sense given the way they see their character. This situation happens most often when a player runs into an “old friend” played by us.