Yeah, Katakana is used for loanwords, imitative words, the names of animals&vegetation. For example, the Japanese say like マクドナルド(makudonarudo) when they say 'Mcdonald'. Many signboards in Japan are written in Katakana. So you can automatically be quick in picking up the words if you live in Japan.
You can also use Katakana when you emphasize what you write.
For example, 愛(あい)してる means 'I love you'.
It can be written like 'アイしてる', if the writer wants to emphasize.
The pronunciations are the same and It would be lucky for you.
Hiragana is from Chinese characters(These were in the cursive style.) of 萬葉集, which is a kind of anthology in the eight centry. In 平安時代(Heian period) Girls at the court had wrote a diary, poems, novels in Hiragana. It stimulated the usage of Hiragana. Most Japanese men used Kanji at that time, so Hiragana was called '女手'(onnade), this means 'Characters of Girls'. At present, Hiragana is a main character the Japanese use. All Kanjis have Hiraganas. So I can subtitute the Kanji for the Hiraganas when I can't remember some Hiraganas.
Katagana is from Chinese characters too. Japanese Buddhist monks omitted some strokes of Chinese characters and added parts of speech&the endings of words. Their various stanography system had brought Katagana's development.
At present, Hiragana is a main character in Japanese.
Let me know if some Japaneses get me wrong.