Illegitimacy in fiction is when a character is born to parents who are not married to each other. When a mommy and a daddy love each other very much, they decide to get married and have babies. But sometimes, in stories, characters have babies before they get married, which is not something that usually happens. This is called "illegitimacy."
In old days, people used to think that having a baby out of wedlock was bad and shameful, which meant the baby was not legitimate. It was like a big secret that they didn't want anyone to know about. Illegitimate children were often treated differently and sometimes even poorly by others, just because of how they were born. But as society changed and became more accepting, people started to see that it's okay for parents to have babies even if they're not married.
Illegitimacy is a theme that often shows up in stories because it adds drama and conflict to a character's life. For example, a character might struggle with their identity and where they belong if they're not accepted by their family or society because of being illegitimate. Or they might feel like they're the reason their parents didn't get married or that they're not wanted.
Overall, illegitimacy in fiction is something that helps us understand different human experiences and learn to be more accepting of people who come from different backgrounds or situations.