How did this happen? And are both branches still alive and functioning?

  • It's a graft.

    While intentional grafts between different cultivars/species are more known among human, it is a process that also can happen naturally. Namely, when two branches rub against each other until the cambium is exposed, they may fuse.

    This may even lead to the formation of new species, if between different species see: Fuentes, I. et al., R. 2014 Horizontal genome transfer as an asexual path to the formation of new species Nature 511 232 235 ...or a in review that cited this paper.