My understanding and experience:
You gain warmongering from declaring war and capturing cities.
Your warmongering decays over time, faster in the early era's.
The amount someone likes you effects how much warmongering you take on. Your friends seem to hardly take on any, your enemies will quickly go up.
It used to be that defensive wars would generate half the amount, as if someone declared war on you. It think it was removed. (I disagree with the change, but hey..)
I don't think it caps? I know it's possible if you go on an early enough and big enough rampage that it pretty much sticks with you for the whole game. Taking a few cities in the early eras usually wears off fairly quickly though.
Edit: Also as far as city states goes, I believe the amount you get for taking cities depends on how many cities the civ has. Taking 1 of 30 cities gives you much less than taking the last city. Since city states almost always have 1 city, it will almost always give you the max amount.