Basically, the AI joins if A) you're at war with them and force them to capitulate because they know they're not going to win the war or B) in your case, they came to you and offered to become their vassal because they're pretty weak and they're afraid of another civilization (maybe yours) and want you to protect them. For example, in the game I'm in now, poor Gandhi was stuck between me and Shaka and had a pretty pathetic empire, so he came to me and offered his loyalty as a vassal, so he doesn't have to worry about me or Shaka wiping him out (since if Shaka goes to war with him he's got to deal with me, and being the most powerful civ in the world, I'm beat the hell out of him if he messed with Gandhi).
They don't give up their cities, but you can direct their research, demand tribute (if they refuse, they go to war, but they generally don't) and 50% of their pop/land counts towards your total, so it's not like he completely gave up, but you do have a certain degree of power over your vassal. As mentioned, they can still pull off a victory.