Settlers of Catan (Knights & Cities): Lose to barbarians attack - same amount/strengths of active knights, different amount of cities
When determining who wins when fighting the Barbarians, and if you lose to the Barbarians who loses a city is based only on the strength of each player's activated knights. Note every instance of knight in this post actually means activated knights.

First to determine if the Barbarians win or you do count up the number of cities on the board (including metropolises) and count the strength of your knights (basic knights are worth 1 point, strong 2, and mighty 3). If the strength of the knights is greater than or equal to the number of cities you win, if it is less than the number of cities the Barbarians win.

If the Barbarians win count the strength of each individual player (ignoring ones with no cities or only metropolises). The player (or players) with the lowest strength of knights loses a city. The number of cities each player has doesn't matter when determining who loses one.