Someone explained it really, really well on Reddit some years ago:
Hexbear.net started out as chapo.chat - a replacement for the defunct r/ChapoTrapHouse community after it was banned from Reddit. It launched one year ago today, based on a modified version of the Lemmy source code. At the time, Lemmy itself was only around a year old, and in an alpha state. Since r/ChapoTrapHouse had accumulated a long list of enemies in its time, a dozen or so members of the community did about a month-long sprint hardening Lemmy and adding features that reflected the needs of the community.
The developers of Lemmy maintained a pretty low-profile community, while the Chapo refugees were the exact opposite of low-profile, so the communities had divergent priorities. It wouldn't be fair to demand the Lemmy developers drop everything they were doing to satisfy the Chapo refugee's needs, but the needs of the Chapo community still had to be met for the project to be successful.
The process was very chaotic, and as a result, the fork of Lemmy used for Hexbear.net will likely never be capable of federating with the wider network of Lemmy instances. A handful of changes were contributed upstream, but many of them likely will never be accepted. None the less, it still abides by the AGPL license and the code is publicly available on git.chapo.chat.
The relationship between Hexbear.net and Lemmy is basically that the Chapo refugees decided Lemmy was the most viable platform to work with, and the Lemmy developers were completely blindsided. The Chapo git repository recorded about 2000 changes within the span of a month and not all of the changes were ideal or appropriate to adopt upstream. Within a week or two of launching, chapo.chat had more users than the flagship Lemmy instance. This was also before federation was officially supported upstream, even though that was always the goal of the project. Had the timing worked out differently, Hexbear might have been federated before adding additional features for their instance, but that's not how things turned out.