Hiraganas were created based on Chinese "cursive writing", (草书)
Katakanas were created based on Chinese "regular script", (楷书)
Most of Kanjis were borrowed from Chinese Traditional characters,
& some of Kanjis were simplified by Japanese official organization.
Hiragana is used for Japanese inherent words,
Katakana is used for loanwords from western countries,
& Kanji is used for loanwords from ancient China,
but Kanji is also used for recording some Japanese inherent words.