Hello. You did not inform the story to which this question refers, which makes it impossible for it to be answered accurately. However, I will try to help you in the best possible way.
When an author includes a story in a novel, he wants to extend and intensify the meaning of the novel as a whole, allowing the reader to make a connection between the two stories that point to the same subject in some way. This extension and intensification of meaning allows the reader to better understand the main themes of the work, contributing to its success, which becomes palatable and identifiable.