It is called as furigana. It is written to make it easy for those who are not aware of kanji or are foreigners. Kids also able to read furigana (i.e. kanji written in hiragana).
Source -
http://codesynapse.net/japanese/what-is-furigana-and-where-it-is-used/