Why does God test believers with hardship?

Each answer is quoted as it is from the commentary of the Quran, with the passage it comes from.