Assign one object to another object

Assign one object (e.g. Taxonomy, or TermsAndConditions) to another object (e.g. Page). The two objects should be connected in many_many (or belongs_many_many) relationship, else an exception will be thrown out.
Please describe the effects of this correctly - so mention that the base object will be created if it doesn't exist already.