yes its random. On nexus there is a mod, you can see that its only percentage. 10% after besiege a castle, some
percent every day, some percent afer raiding, and so on.
Look:
<RaidImpact>0.05</RaidImpact> <!-- every successful raid contributes X% for a chance for peace a day -->
<SiegeImpact>0.50</SiegeImpact> <!-- every successful siege contributes X% for a chance for peace a day -->
<CasualtyImpact>100</CasualtyImpact> <!-- every X people contributes 1% for a chance for peace -->
<DailyCheckChance>0.25</DailyCheckChance> <!-- Vanilla value is 0.1 = 10%. This is the chance that they'll consider considering peace or war. -->
I have change the values to my taste. But yes, actuall it look like it is complete random. I think actuall this game don't have a thing like diplomacy. Only random war, peace