To form an alliance the faction you're dealing with must have a hostility no greater than 50. Assuming that, you must also be able to afford the tribute they demand. You can reduce the tribute or arrange for them to actually pay you by raising their intimidation. This can be achieved by defeating their armies in battle or bringing a significant body of troops near their capital before they can reinforce it. Once you secure an alliance all of their assets become yours. Their network of supply lines will also stay in place saving you the trouble of reorganizing them from scratch (unless you want to). While they are within your alliance you can recruit units from their cities. Allied units do not level up and I believe they cost less than mercenaries (someone confirm this?).
From then on they basically function as conquered cities that don't revolt. However, you cannot tear down their walls, and later the faction may demand a reduction in the tribute they pay or even that you have to pay them tribute. In response you can comply with the demand or ignore it until time runs out. When that happens you will recommence hostilities, but all of their cities will stay under your control as conquered territory. You will have to install garrisons in the cities to keep them from reverting back to their former faction. Any allied units recruited from that faction will become mercenaries.