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.
To make it even more difficult to implement, all these different installations are spread over many different servers (= federation). Which all can have differences in their software again and different speed and rules about how often they synchronize their data, etc.
I think the confusion, in part, stems from the fact that if someone proclaims they are “a liberal” it often turns out they care mostly or exclusively for economical liberalism. At least that’s my impression when talking to people.