These are homophones in Japanese. Same thing as words like their/there/they're or seas/sees/seize, etc. Words that sound the same but are written differently. The Japanese language has tons of them. Often, the ambiguity around homophones is used as a source of humor, causing misunderstandings between characters in anime/manga or puns that add a layer of humor to an otherwise normal thing to say.
Both kinda, they have different scripts because they have so many homophones. Japanese has far fewer phonemes (possible sounds) compared to english, this combined with the fact that you usually can't have two consonants together without a vowel in between makes it so the amount of possible words is very limited. Because of this if you used just the "phonetic" script hiragana ( each character represents a sound) then it would get confusing since かみ that represents the sound "kami" would be confusing as to what you're referring to. So they mix in kanji, Chinese characters where a character represents a thing, to distinguish these homophones.
Japanese has significantly fewer sounds than many languages, so homonyms are inevitable. Thanks to kanji this isn't much of an issue in written Japanese, but spoken Japanese (and Japanese written without the use of kanji) relies heavily on context.
The alternative would be ridiculously long words. Example: the English word "extra" (five letters, two syllables) is pronounced "ekisutora" in Japanese (still five letters, but also five syllables); this is a result of every consonant needing to be followed by a vowel (except for "n" and a short list of compounds like "sh"). Additionally, Japanese only has five vowel sounds, plus a few that you can force out (e.g. "ka" can be slightly modified to "kya" to approximate the "a" sound in "cat"). Japanese also contains fewer consonant sounds than a number of other languages.
I find fun to learn Japanese. It's the fourth language I study, and so far it's been both different and intuitive, but I fear the moment where I need to go deeper into kanji, given the limitations you mention.
It's also a slower process than learning any major language, as it took us a few weeks to get to review their letters. Its been fulfilling so far, but I don't know how invested one can be once you reach a certain point of increased complexity.
It depends on what your likes/dislikes are when it comes to languages. I much preferred learning kanji to memorizing noun genders and verb conjugations of European languages.