Two different types of software - Lemmy is a link aggregator like reddit, Mastodon is a microblogging service like twitter.
But, underpinning each of them (and various other types of software too) is something called ActivityPub. This is a protocol - i.e. its a method of passing information from one place to another. Just like SMTP is a protocol for passing emails and FTP is a protocol for transferring files.
So just like GMail uses SMTP to send/receive email, so does Hotmail or Yahoo etc etc. And just as Lemmy uses ActivityPub, so does Mastodon.
What this means - in theory - is that content can travel between any piece of software that is underpinned by ActivityPub. And in fact, this already happens. Mastodon users see Lemmy communities (e.g. c/fediverse) as just another user. So they can follow Communities and Post to them. Lemmy can’t do that at the moment because it is nowhere near as mature a product as Mastodon.
The other issue (as has already been mentioned) is that Lemmy and Mastodon (and PixelFed, PeerTube etc) all have different types of content. Lemmy content usually has a much greater word count per post for example. It’s like posting a WordPress blog post to Twitter.
These issues will get resolved with time, the Fediverse itself is relatively new. Lemmy is very new.