Because they use the same protocol: ActivityPub
For example, E-Mail gets send over the protocols pop3, smtp, imap. It doesn't matter if you use Outlook or Gmail for Android or whatever email program. They still send data to each other using these protocols. Therefor both know what to do with the information exchanged.
There is software that is completely different from Lemmy and Kbin which can still interact via the ActiviyPub protocol. For example Mastodon for Twitter-like mini blogs. Or PeerTube which is a video platform. Pixelfeed is an image sharing platform similar to Instagram and the like. But since they all use AcitvityPub you can interact, comment, vote etc. on these images and videos or mastodon posts here on Kbin or on Lemmy.
In theory this sounds great. But obviously the different software needs to have the backend and the UI to support these features implemented.
To make it all even more difficult to implement, since all these different installations are spread over many different servers (= federation). Which all can have difference in their software again and different speed and rules about how often they synchronize their data.
Is there a description like this for kbin.social? Not sure if it's just because of some cloudfare issues but for example communities on the Lemmy instance feddit.de do not show up for me on kbin.social. Some of their posts do, though.
But if I search for e.g. !ich_iel@feddit.de on kbin.social it won't show up and therefore I can't subscribe to it from kbin's side.
EDIT
Now it suddenly shows up under Magazines on kbin.social. How often do new communities on Lemmy instances get federated to kbin?