Diplomacy
Understanding diplomacy can be difficult; how it works is not made very explicit.
The AI prefers to declare war on weak opponents and the weaker an opponent the more likely war will be declared. The strength of your army factors into the faction power rating which determines your power versus other factions. If enemy factions are looking like they might declare war, avoid going after that monster army or quest that might wipe out your army. The decrease in power rating may be the tipping point and the AI might declare war.
Offering tribute is a great way to avoid war... for awhile. It's not explicitly stated, but offering tribute does not allow either faction to declare war for 30 turns (and unlike trade and economic treaties, the AI cannot cancel these if relations worsen). If you initiate the offer you can save yourself some gilder as you won't have to offer any of it up front (unlike when the AI demands tribute of you). However, the AI will only accept tribute from you if he's Cool towards you or better. After relations get Unfriendly or worse, you'll have to hope for an AI initiated demand to postpone war and that demand comes with an upfront gilder cost.
Don't declare war unless you have a really good reason. Declaring war reduces relations with other factions (i.e. if you declare war on a Kingdom, other Kingdoms will dislike you more). You'll get attacked eventually, so be patient. In the meantime build up your army and cities, and when those first waves come, take advantage of those upgraded outposts that you placed on key avenues of approach. Once the first wave is dead, go on the offensive.