This is a very good question. Neither Lady Macduff nor her son has appeared before this scene. Evidently Shakespeare wanted his audience to get to know them as people so that their murders would arouse pity for them and sympathy for the absent Macduff. Female roles were played by young males, and Shakespeare must have had more than one actor in his company who specialized in female impersonation. Possibly the playwright wanted to use this other actor in the performances of Macbeth and wrote in a little extra dialogue for him (her). The same boy who played Banquo's son Fleance might have been used for the part of Lady Macduff's son. Shakespeare makes a point of getting the audience acqainted with Fleance in the opening of Act 2 before he and his father are attacked by the three murderers in Act 3, Scene 3.
If Shakespeare decided that he wanted to show Lady Macduff and her son being murdered, then he must have decided that he would have to have them present at the opening of the scene and then have the murderers burst in on them. In that case there would have to be some conversation and some "business" between them. We learn in Act 4, Scene 3 that everyone in the castle was slaughtered.
Wife, children, servants, all that could be found.
So Lady Macduff and her one son are used to represent a whole castle full of people, including several more of Macduff's children. This might have justified giving these two characters as much time onstage as they received. It could even be imagined that some of the slaughtering was actually taking place while mother and son were talking and joking and that, instead of being the first to be killed, they were among the last.