Hi.
This is a very good question. Please let me try to answer. As you know, hiragana and katakana is a table based on 5 vowels, a, i u, e, o.
For S sound, in theory, we should have:
sa si su se so
But Japanese has no sound for si and hence it's changed to "shi" which is considered to be the closest sound to "si" in Japanese. Technically "shi" is correct but people can use "si" for Romaji also since it's shorter. But both should be pronounced as "shi".
Same goes for T sound.
ta ti tu te to
But no equivalent sound in Japannese for "ti" and "tu" so we substitute them with
ta chi tsu te to
but again, it's ok to write "ti" and "tu" to mean "chi" and "tsu" as it's shorter and easier.
As you can see now, "shi" and "chi" are totally differently pronounced (and therefore uses the different hiragana/katakana characters. (し vs ち) (シ vs チ)
Similarly, Z sound,
za zi zu ze zo
No sound for "zi" so "ji" is substituted.
Lastly, D sound,
da di du de do
No sound for "di" so "ji" is again substituted as it is considered the closest sound to "di".
I hope this helps.