How do Cadet branches work/is there a guide anywhere to them? I just had a vassal create one after having originally been part of the main line until I gave the territory to my brother 3 or 4 centuries ago.
There are two ways that someone can form a cadet dynasty:
1) By being a cadet -- a younger son in a large dynasty who is heir to no titles and is either not a close relative to the dynasty or not of the dynasty head's culture. If the cadet gains a title and has a child who can inherit his title, he may decide to form a cadet dynasty. It's not guaranteed, and the AI won't do it unless they're a legit bastard or the title they have is Duke+ and they're ambitious/proud.
2) A member of a large dynasty who becomes a king/emperor or independent duke, is ambitious, and has 1000 Prestige -- and has a possible heir -- may elect to start their own dynasty if they are not a close relative of the dynasty head (and neither were their parents) or are not of the dynasty head's culture.
This doesn't apply to Muslims, however, who will always start their own dynasty if not part of their dynasty head's realm.
There are other restrictions -- the AI won't do this in realms with some succession laws, like Tanistry or Elective Gavelkind, and won't do it if they are heir/pretender to a title held by someone of their dynasty -- but those are the most important aspects.