Authors do variable amounts of research to background their characters. Sometimes shockingly little. Many HN readers can probably relate to encountering an eyeball-rolling "hacking" scene in a thriller. It's possible that a diligent author can write a character of a certain background just as well never having lived it, but the odds are not in their favor.
The not-having-lived-it problem leads to some interesting challenges with historical fiction. Nobody alive today has been a 14th century French knight. Which authors really try to do their research and don't just treat time and place as set dressing for generic drama? How much work am I going to do as a reader to discover these harder-working authors? Sometimes I wonder: should I just dive in to scholarly source material about medieval history instead of reading novels set there? Sometimes the answer is "yes, just read history."
When the whole thing is fiction, you don't need to fuss about which parts are historically accurate.
Historical fiction must necessarily be a blending of truth and lies, and as such it has never held my interest.