hiragana for grammatical structures, such as verb and adjective conjugations, particles, about anything except for foreign words and nouns, verb stems, adjective stems and so. Hiragana are also often used instead of kanji, I think it's to show a different meaning, making it become a grammatical structure too, but I'm not sure. Standard expressions are often done with only hiragana as well. But hiragana and katakana are sometimes also used without any logic at all.