You should know the context in a written piece
The primary reason why Dickens wrote David Copperfield is because G. it was too painful for him to confront his memories directly in an autobiography.
This way, he could write about his own life, but in a different way, from a different point of view, which wouldn't be as difficult.