When you create a narrative, you determine, one way or another, how best to interest the reader in that narrative, what kinds of characters work, and would be realistic. If I feel writing in the voice of a female or a black person is the best way to do things, then that's what I'll choose to do. I want my story realistic after all.  Do I know what it's like to be a female? I mean, as well as an actual female? No. But I can make it seem realistic, and that's what's important. I don't know what it's like to be a soldier or police officer or lawyer or doctor, either, but I can still do research and write realistically.