The history of the Japonic languages (i.e. Japanese and the Ryukyuan languages) is pretty interesting.
The Ryukyuan languages probably reached Ryukyu around 1000 CE, but diverged from modern-day Japanese several centuries before that.
Japonic languages likely arrived on the archipelago with the Yayoi migrations. These probably came from the Korean peninsula; there's evidence of Japonic toponyms there, particularly south of the Han river. There's also the existence of the Gaya confederacy later on, which is something of a rabbit hole that I won't be exploring here. As for why you don't see any Japonic languages indigenous to the peninsula today, the remaining speakers were assimilated by Koreanic-speaking peoples, the process probably finishing in the 1st millennium.
Tracing the Japonic family back further than that is much more controversial, but there have been attempts. The most convincing to me is the idea that they came from somewhere in South China, particularly from somewhere near the Yangtze. The evidence for this is mainly hints of contact between Pre-Proto-Japonic and Kra-Dai languages, with other things like native words for animals not found so far north, being sun-worshipping as opposed to sky worshipping, and some similarities between certain types of shrines being used as supporting evidence. Under this view, wet rice cultivation would have spread to the peninsula and archipelago with them, which seems to track.
There are alternative ideas. I've seen one where the idea is that Japonic speakers from South China to the peninsula and the islands, but that they were sister groups rather than one being descended from the other. It's hard to evaluate either way, but I'd say that the timeline lines up less well for this one than the explanation I presented first.
There's another idea that Japonic was originally spoken by Jomon peoples on the archipelago. This doesn't really make sense, given that the one language we know of that's definitely known to be related to Jomon languages clearly doesn't have a genetic relation to Japonic (admittedly, the Jomon were there for like 10,000 years, so there was enough time for language diversity to accumulate to the point where such a relation wouldn't be obvious). There's also the fact that the Yayoi, who definitely did speak Japonic, are clearly not native to the islands and significantly outnumbered and would eventually replace the Jomon everywhere they settled, me
Post too long. Click here to view the full text.