preventing fraud in a mining pool
The very last line of a block effectively contains:

Reward for Solving this Block: Add 12.5BTC to Account for [Mining Pool].


If the miner tried to change that line to read

Reward for Solving this Block: Add 12.5BTC to Account for [My Personal Account].


the altered line would change the block, which would change the hash, and their Proof of Work answer would no longer be valid.

So if a miner solves a block on behalf of the pool, they cannot submit that block for themselves; it will no longer be a valid solution.