If you want the specific details...
What happens is there is a ship in the city with at least one worker on it. When you capture the city, normally what happens is any workers/settlers in the city are captured (settler is "captured" into a worker), and all other units in the city are destroyed. The bug is that the ship gets destroyed, which "bumps" the worker on board to the nearest city (of the Empire that used to own the city you just captured). But because the worker was in the city when you captured it, that worker still gets "captured" by you. This means you now have a worker sitting in an enemy city. Since having a unit in an enemy city is the "capture" condition, you immediately capture that new city.
And yes, you can actually "chain" capture this way. For giggles, I set up a test condition where I completely eliminated a 12 city Civ just by capturing a single city.
Bh