The hypocrites withdrew from the battle, and they were saying: If Muhammad had been a prophet, we would not have been defeated in Uhud… So it was a process of purification.
وَيَمْحَقَ الْكَافِرِينَ {and destroy the disbelievers.}: So things became clear and people were classified after the Battle of Uhud.