Macduff knew what Macbeth did to King Duncan and his own friend Banquo - he knew that he killed them so he wanted to protect his family from Macbeth because according to the prophecy, Macbeth would try to kill them. Macduff thought his family was safe at his castle, but unfortunately, that wasn't the case as Macbeth's people managed to kill Macduff's family.