The Divine Purpose of Trial: The defeat distinguished the true believers.
The defeat at Uhud was by God's permission so that He might distinguish the true believers from the hypocrites. View trials as spiritual filters. Hardships serve to expose the insincere and purify the sincere, making it clear who is truly committed to the cause.