Hidden Power is a bit of a confusing move at first, so here’s a rough breakdown:
• What makes Hidden Power special is the fact that it can be any of 16 different types (it can’t be Normal or Fairy).
For instance, I have a Porygon Z with Hidden Power: Water and another with Hidden Power: Ghost. For all intents and purposes, those two moves function as Water and Ghost-type moves (in terms of what they’re super effective or not very effective against).
• When a Mon gets Hidden Power, the exact typing will be randomly selected. If you TM that Mon to a different move and then back to Hidden Power, it will receive the exact same Hidden Power again.
So for example, if I TM my Porygon with Hidden Power: Water to give it Charge Beam, then TM back to Hidden Power, it will still be Hidden Power: Water. That typing won’t change via TMs. Trading that Mon won’t change its Hidden Power either.
• When a Pokemon with Hidden Power evolves, the evolved form will once again be assigned a random Hidden Power type (if it can learn the move).
So if you have a Porygon 2 that knows Hidden Power: Steel and you evolve it, your Porygon Z is not guaranteed to also get Hidden Power: Steel. It will once again be randomly selected.
• Hidden Power is usually desireable in only certain scenarios. For example: Ho-Oh, who doesn’t have any standard Fire or Flying moves. A Ho-Oh with Hidden Power: Fire will synergize well with Fire Blast as its charge move. Similarly, a Ho-Oh with Hidden Power: Flying will synergize well Brave Bird.
In the case of Porygon Z, Hidden Power: Grass will synergize well with Solar Beam, Hidden Power: Ice with Blizzard, and so forth.
Hope that helps!