It's not ethnically homogeneous--it's a truism that is taught about Japan but it's only true if you ignore a lot of the inhabitants and history. For most of its history, some of the islands of Japan--Kyushu, Shikoku, Honshu--were inhabited by the Jomon people. Current studies of bones and of archaeological artifacts are showing that these people were biologically and culturally distinct from the majority of people who currently inhabit those islands. Likely (still under debate and being studied) people came to japan in larger numbers starting around 300 BC from the area now known as Korea and China, and they rapidly spread throughout Kyushu, then spread to Shikoku and Honshu. There was some interbreeding between these different populations, but most of the existing Jomon population was pushed north by the encroaching newcomers. Today, their last remnants are known as the Ainu and live in Hokkaido. They are definitely a distinct ethnic group with their own culture and are recognized as the indigenous people of Japan. In addition, there are other groups--the Ryukyu Islands, including Okinawa, are Japan now. It is expedient for a number of reasons to say that the inhabitants are ethnically Japanese and their indigenous language is a Japanese dialect, but in truth the populations and language are quite different. But since Okinawa became a Japanese prefecture in 1972, there has been a strong movement to homogenize the population and teach everyone standard Japanese.
Also, there's a non-trivial population in Japan that is descended from Koreans who moved there in the early 20th century. They represent a distinct ethnic group.
Even outside of the Ainui the different regions of Japan had and, to a degree, still have a very distinct dry of identities. The idea of a singular Japanese identity is really the product of the late Edo and Meiji period. Before then one can see the idea of Tenka Fubu expressed by Oda Nobunaga, but this was an adaptation of Chinese conceptions of unified imperial monarchy rather than national unity. The political and economic conditions of the Edo period created the opportunity for much more movement for trade and pilgrimage. This movement brought people from many other regions together, and created the space for the formation of a unified Japanese identity.
My main source for this is Reshaping the Landscape of the Gods which traces the development of a prominent shrine and how it related to broader social trends across all Japan.