The Fourth Raikage, A, learned that Rasa, the Fourth Kazekage of Sunagakure, had surrendered to Ying Yue. Rasa had retained his position as Kazekage, allowing Sunagakure to preserve a degree of autonomy and maintain basic social order.
This gave A a glimmer of hope: perhaps surrendering to Ying Yue was the only way to save Kumogakure.
By surrendering to Ying Yue while retaining his position as Raikage, he could preserve Kumogakure and ensure that the people of the Land of Lightning would no longer be caught in the flames of war.
To that end, A sought out Lightning Flash, the newly appointed Feudal Lord of the Land of Lightning, hoping to persuade him to reconcile with the Resistance Army.
Lightning Flash was originally a distant relative of the Land of Lightning's feudal lord family. Since the previous Feudal Lord had left no heir, A had pushed him onto the throne.
For Lightning Flash, becoming the Feudal Lord of the Land of Lightning had merely been the result of being pushed into the position. He had neither ambition nor a power base.
He had never been attached to power in the first place, and he knew full well that continued resistance was tantamount to courting death. Thus, he readily expressed his willingness to surrender, placing his hopes in Ying Yue's lenient policies.
In the end, A and Lightning Flash jointly submitted a letter of surrender to Uchiha Ying Yue. With that, the Land of Lightning was peacefully liberated.
Ying Yue formulated policies for Kumogakure and the Land of Lightning similar to those in the Land of Wind. He retained A's status as Raikage and made him the military leader of the Land of Lightning, while stripping the Feudal Lord of the Land of Lightning of his absolute authority.
As for the