What can cause a City State to enter "permanent war" with a main Civ?
If you kill quite a number of units of a city state and/or keep trespassing on their territory enough to get your score very very low over an extended period of time, they eventually will be convinced that you are so evil it's not worth considering peaceful coexistence, so they will be in perpetual war with you. You will not be able to buy their friendship and relations will not heal by themselves over time.
Actually that doesn't mean too much, though. If you go near them, they'll attack you, and if you leave cities undefended near them, they'll capture those. Apart from that, they won't hunt you across the map and they won't make others hate you as well. If you just leave them alone now and make their area taboo to your units you can still get along with the other city states just fine.
You might choose to have one perpetual warring city-state next to your army outfitter because city-state units train your troops longer than barbarians do.
So as I've answered in those comments, I'm pretty sure that if a city-state is conquered and then liberated, it then remains in a perpetual war with the ex-conqueror. I remember I tried to force that civilization to make peace with the city-state as part of its "surrendering trade agreement", but the option was grayed out and there was a popup explaining this is because of a perpetual war.
I know of no other reason for the permanent war, other than the above-mentioned aggressiveness reason.
Since we're not sure and have to piece together the rules from evidence, I present two cases to help. Two city states decided on permanent war with players in my most recent multiplayer game:
I declared war on a city-state, only took a worker, not other aggressive moves, then gave peace. I may have trespassed once before the war, but I am not certain. Before the city-state was through being angry with me from the first war, I declared war again. On this declaration, another city state joined the war against me as an ally of the first. As of my second declaration of war, we were at permanent war.
My friend conquered one city state, then attacked a second, failing to take it. I believe he bombarded the city some. Later, he went to ask for peace, and found the war was permanent. (I am not 100% certain of the details of this. I will ask next week and clarify any errors.)
There several things that look like they could contribute to these two cases:
- The simplest reason: strongly negative influence.
- A second declaration of war on the same city state.
- Actually bombarding the city of the city-state.
- Attacking multiple city-states.
Another scenario where you go into permanent war is when you have a tendency for belligerence. I've come to notice that when you keep invading city states, along with a few declarations of war against opposing civs, a warning first pops up that the city states are afraid of your belligerence. If you keep going on despite the warning, and even if this is a quest from another city state, it will trigger permanent war for all city states that aren't allies or friends.