You tell her when the opportunity arises naturally.
For example, your daughter may see a pregnant woman, or you and your wife may be planning on having children together. When this occurs, your daughter will almost certainly ask a question like, "Did I grow in your tummy too, mommy?" At that point you or your wife simply say, in a matter-of-fact way, "No, you grew in another mommy's tummy."
And then you let your daughter guide the conversation.
If you treat it as something matter-of-fact and don't make a big production of sitting down and telling her, then she will also treat it as matter-of-fact. She may have more questions immediately or she may not.
Eventually, she will ask, "Why did I grow in another mommy's tummy?" or "Then why is mommy my mommy instead of the other mommy?" or a similar question. You respond with a matter of fact answer: "When you were born, you had another mommy, but she wasn't able to take care of you." And continue to let her guide the conversation.
When she asks, "Why wasn't my other mommy able to take care of me?" then explain that.
This way the conversation grows and evolves naturally, and there's no implication that your wife isn't your daughter's "real" mother. If she asks about whether she had another daddy too, then you simply tell her, "No, daddy has always been your daddy," and answer any questions that may come out of that as well ("Why did I have another mommy but not another daddy?").
A few notes about this approach:
Make certain your wife is in agreement, because she will likely be the one to be asked about it first (and she will likely be asked most of the questions, since it's about her role in your daughter's life).
The keys to this approach are to answer question immediately, truthfully, age-appropriately, and in a matter-of-fact manner. An example of this is the reply we gave our sons when they asked about where babies came from at age 3; with our older son, these questions were spaced out, but with the younger the two questions came back-to-back. Notice that these answers are both age-appropriate and truthful--they don't contradict anything learned later about human development:
- The first answer was, "Babies grow inside mommies until they're born."
- When they asked how babies got there, the reply was: "When a mommy and a daddy love each other very much and in a very special way, sometimes a baby starts to grow inside the mommy."
Don't give all the information at once. Let your daughter guide the conversation. I.e., at age 3 or 4, she will probably not immediately take the conversation to the point that you would need to tell her that your first wife died, especially during childbirth. When she's ready for that information, she'll ask questions that will naturally and easily lead you into discussing it.
Fortunately, this isn't a topic we've had to grapple with, but this is an approach we've used successfully to discuss many things with our children over the years, including the ever-dreaded, "Where do babies come from?"