I'll try and summarize things a bit in my own words, hopefully easy for you. I hope you do not mind reading
- Japan had its own spoken language
It is said that there were a few original Japanese languages pre-history. But since they did not have writing systems, nobody knows what they were like, and we can only guess and speculate from the oldest scripts that were written in Chinese characters.
- First wave of Chinese characters : 呉音
In general, it is said that people started importing Chinese characters around in 5th to 6th centuries AD. (But this first wave also includes those imported before those times.)
<1> Kings of Japan at that time were said to be sending tributes to the rulers of southern China and it is believed that the pronunciations we imported then were originally from there, most likely around Shanghai, but no proof.
<2> Many Koreans came to Japan with Chinese books(mostly of Buddhism) and their own knowledge of China and Chinese. Many of them worked as clerks who kept records in Chinese for big houses. Thus it is believed that the pronunciations Japanese learned back then were through Koreans. No proof, but most likely.
- Second wave of importing Chinese characters : 漢音
In 7th to 8th centuries AD, Japanese started sending students directly to China to learn Buddhism and Chinese. The Chinese characters imported around this time were from Chang'an(長安/ now called Xi'an/西安）, the biggest Chinese city back then. Now you can guess we started to learn new pronunciations and some pronunciations of the first wave imports were lost, although some stayed to survive. Many On'yomi we use now are greatly influenced by this wave.
- Third wave of importing Chinese characters : 唐音
After around 12th century AD, Samurai days, Shoguns traded directly with Chinese and also imported Zen teachings. However, the pronunciations imported then were not valued much later days, maybe because they were of merchant terms and Zen-specific.
- Hiragana + Katakana, and Kundoku-method
The intellects in ancient times used Chinese when writing and reading, while they talked in Japanese. Chinese characters were used for phonetic values for Japanese specific culture, such as poems and histories, but it was not the mainstream at first. As more people started learning, they invented Hiragana and Katakana to make it easy for learners, as well as Kundoku which is a method to read Chinese without translation by using symbols and Katakana.
As Japanese learned Chinese, they started to coin their own Japanese words expressed in Chinese characters using its meanings to match with the Chinese-ish official documents. Some new Kanji were also invented by using parts of Chinese characters.
As Western cultures started pouring in, the intellects coined to translate foreign words and concepts, sometimes by Chinese characters' meaning, sometimes by the sound, or even both. (As time goes by, however, foreign words flooded, and we could not manage to always translate them all. thus, started using katakana instead, you know it is much easier!)
- Reverse import of New Kango by the Sinosphere
China and some other countries that use Chinese characters started to reverse import of Japanese made-up words and kanji. It is said that Chinese intellects who studied in Japan translated Japanese books into Chinese in Meiji era and that many of Japanese kango were introduced to Chinese, and then to Koreans and other kanji using areas.
Just bits and pieces of the history you seem to be interested in... I hope some mysteries are solved.