Krishna tests to increase our devotion
The Pandavas were devotees, but at the same time, they were king. There was attachment. So therefore Krishna took away their everything — their kingdom, their wife, their position, their honor — test him, and still, they did not give up Krishna. Therefore they came out victorious. So Krishna sometimes tests His devotees, that how much devoted he is. He forcibly makes him renounced in order. That is Krishna’s special favor.
– Srila Prabhupada (Lecture in Geneva, June 2, 1974)