I recently learned the following concept in the Chofetz Chaim’s book Ahavas Chessed, section 2 chapter 5. I quote verbatim in translation. You can hear this as an audio file here.
“How can we bring Hashem’s kindness into the world, especially when we face difficulties from every direction that seem to overwhelm us? The answer is that by attaching ourselves to kindness, we draw down Hashem’s kindness onto the world.
“The power of this is revealed in a beautiful piece from the Tana D’bei Eliyahu Rabba at the end of chapter 23. There he states that when the Jewish people were in Egypt, they all gathered and lived together because they had made a single group. And they made a covenant together that they would all do kindness for each other, and keep the covenant of circumcision, serve only their Father in heaven, and not leave the language of their father Yaakov, rejecting the Egyptian language.
“What was the reason why they made this pact to do kindness to one another? The idea is as follows. When they saw that there was nothing they could do to be saved from the decrees of Pharoah, and the servitude was getting more difficult every day, what did they do? They gathered together and brainstormed about what could be done. They agreed to only go in the path of Hashem, not changing their names or language. They also areed to do kindness to one another in order that through this the kindness of Hashem would be aroused from above upon them. The evil decrees of Pharoah would thereby be nullified in the end.
“In truth, it was indeed so in the end, because this matter was the root cause of the redemption, as the verse states, ‘נחית בחסדך עם זו גאלת, נהלת בעזך וגומר’ – ‘In your kindness you made them rest, this nation that you redeemed, you led with your strength etc…’
“נחית בחסדך – In your kindness you made them rest – this refers to the kindness [of the people of Israel]. You led with your strength – this refers to the Torah, for in truth they also had Torah in Egypt as it states in Yoma (28B) that even when the Jews were in Egypt they did not stop learning.”
We see from here the path to Geulah and redemption from our difficulties is by strengthening חסד – kindness between ourselves and our fellow man, and by strengthening our connection to Torah. See the explanation of the dream with Moshiach’s rings.