It happened to the daughter of a friend of mine; my friend ended up raising the child until he was about 8 years old.
How did the daughter not know she was pregnant? Apparently it was a combination of obesity, lack of knowledge (she’d never been pregnant before, so the “feeling of a baby moving inside her” was not something she could be expected to recognize), denial, general goofiness/irresponsibility, and a history of irregular periods.
As big a shock as it was to the daughter, though, it must have been my friend who reeled from it the most. There she was, thinking that her daughter (about 20 at the time) was finally launched into the world and more or less taking care of herself, now my friend could relax, when … SURPRISE! She got to be a parent all over again. (Daughter was something of a mess, only kind of hanging on to her own independence, and not in any shape to take on the responsibility of a child.)
The surprise delivery turned into a fantastic kid, by the way. Super smart, polite, talkative, extremely cute; despite the non-promising start to his existence, I think he has a good shot at growing up into a stable, productive, and decent person, thanks in no small part to his grandmother.