It's one of the most terrible features in the game; it's a function to allow high level AIs to permanently ally and freebie tech swap even when permanent alliances aren't enabled. The only features that even come close to being as bad as PAssals are events, lying GUI, and the Apostolic Palace.
They function on a combination of power + relations; the higher the power/better relations, the more likely someone will peacevassal. Individual AI are more/less likely to PAssal, but anyone can/has done it.
The vassal state mechanics are broken. I proved this yeas ago by following these steps:
1. Declared war and took most of my opponent cities
2. Opponent wouldn't capitulate
3. Opened world builder and deleted one of my own vassals, lowering my power
4. Opponent would capitulate as a result of deleting my own vassal
and
1. Declared war and captured 8 of an AIs 10 cities
2. "we're doing fine on our own", despite being at war with someone 4x their power and losing 80% of their cities, once again ONLY because there were a couple small/weak civs out there..
and
1. Declared war on a master and vassal
2. Quickly took cities from the master using nukes/paratroops, his vassal broke free
3. Master now won't capitulate because "he's afraid of my enemies", despite ME having 5x the power of either.
Anyone who thinks vassals states aren't broken has some 'splainin to do. I'll concede it's not not as poorly implemented as events/global warming, but it still sucks a big one.