That's actually not true. You can make an alliance with the enemy of one of your allies. I've done it quite a few times. The AI can do the same.

Bh