For some reason my one of my Greninja's Hidden power types isFire and the others is Rock.
Hidden Power's type is determined by indivdual values. Individual values are basically the Pokemon's DNA or finger print so its basically random. individual values are super complicated and the only way anyone can fully understand it is by reading about it on Bulbapedia or another database/wiki.
Bulbapedia articles about Hidden Power and individual vlaues:
http://bulbapedia.bulbagarden.net/wiki/Individual_value http://bulbapedia.bulbagarden.net/wiki/Hidden_Power
Very hard to explain how but this link shows how. Sorry for not being able to show in the answer.