Trade agreements give you the ability to trade with that nation. Well duh, but since each of your cities has a limited number of fleets it can send out based on the size of it's port it pays to have the most options. If war disrupts trade to one city I believe the AI will adjust and switch to other options.