Flannery O'Connor was truly a genius and an extremely gifted writer. I think that there are two major things in her life that influenced her writing; her religion and her disease. She was a very religious Catholic, although the trappings of religion were less important to her than her faith. She also suffered from Lupus, an inherited disease that also killed her father. She died when she was only 39 years old.
If you do some research, you can find many interviews in which O'Connor explains how she incorporated her faith in her short stories.
Living with her impending death caused her to contemplate the unfairness of life. This comes out in her stories. Also, she was conflicted over how a loving God could allow evil and suffering in the world. This caused her to write depressing and complex fiction with multi-layered themes and complicated characters.
You can read about her hereon eNotes.