To summarize, creating a memorable NPC is part preparation work by getting to know the players and PCs, part generation and record-keeping, but mostly something that is an ongoing process throughout the game as the NPC's build more depth as needed and appropriate.