I have the following circuit below, with part of the solution:

I need to find Z. I'm confused about the KVL equation below (fourth line):

If I understand correctly, they used loop analysis: with one loop around the entire circuit and one loop around the right mesh (Io). So wont the currents Is and Io be added together when you reach the capacitor? Because aren't both loops are passing through that point? So why isn't the KVL equation 2Is -j1(Io + Is) + Vo = 12∠0? Can you explain?

If I understand correctly, they used loop analysis: with one loop around the entire circuit and one loop around the right mesh (Io).

I'm not sure I see the second loop in this analysis. It looks like the first three equations are just Ohm's law - the loop around the right mesh never really comes up (if it did, you would see a KVL equation for it).

In any case, the current $I_0$ is literally defined as the current through the capacitor, so the voltage across it is $$V_{cap} = IZ = I_0 (-j1 \Omega)$$ If you replaced it with two loop currents (as you described), then the current through the capacitor and the 1 ohm resistor would be $I_1 + I_2$, and you'd have to re-consider the first three equations.

KVL deals with voltage drops, not currents. The voltage drop across the resistor is 2*IS and the voltage drop across the capacitor is -jI0.

Remember I0 = IS - I2 in your diagram so KVL has already taken the current divider into account here.