Job Recruitment Website - Property management - Why can Ma Dai slay Wei Yan in the official history?

Why can Ma Dai slay Wei Yan in the official history?

Kongming expected Wei Yan to take the blame before he died and gave it to Ma Dai. After Wei Yan turned against Shu, Wei Yan intentionally surrendered to Cao Cao. But Ma Dai advised him that Wei Yan could not be defeated in Shu today, and Wei Yan began to attack the barracks in Shu. It seems to be Jiang Wan. He told Wei that he dared to say "Who dares to kill me" three times and let him own the city. Wei Yan did say it. The second time, Ma Dai responded a few words.