What happens when a city-state captures a city that cannot be razed?
Solution 1:
Normally a City-State will just raze any city that it managed to capture.
This could make giving a City-State lots of units a handy way to destroy a city or two in the vicinity of the City-States (remember, they don't roam far from their borders) without getting the world mad at you; you just have to ensure the CS stays at war with the target player until the desired target is destroyed.
However, for any city that it captures that cannot be razed - that is the original capital cities of the main Civ players and any other City-States - the capturing City-State simply takes the city as a puppet, leading to the odd scenario where a City-State player controls more than one city!
What they do not do is liberate the target if it could - for example, in my current game, Venice has just captured Stockholm, which was being held by the Aztecs. They didn't liberate Stockholm, just took it as a puppet, and so Venice now controls both cities (and the Stockholm player is still "out" of the game).
Solution 2:
Extreme example: In a single game, I have had an allied single city state capture 3 cities and hold all four for most of the game. This happened without my military.
France was on a small continent, which had 4 bordering city states on the coast. I was playing a pretty peaceful game and was allied to all 4 of those. When I DOWed France, those 4 city states started knocking down french cities, to my shock. Tyre captured Lyon, Paris (yep, the capital) and Marseille, with some help from others. It was pretty awesome to watch, and especially because I got bonus science from all those cities due to patronage :). They were not razed, I don't know why (Paris cause its a capital, but the other two I dunno). That was a while ago, a past patch may have changed the mechanic.