Both P2SH and P2PKH addresses rely on HASH160. The difference is in the script.
In a P2SH address (
3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4 in your example), the script is
a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 87 (spaces mine). This amounts to
OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUAL. In short, the Bitcoin network will take a provided redeemscript and signature data, and compare the hash160 of that redeem script against what is given in the address outputs.
1H825FgspbkznbiGAnAjFjan7dmYFjpsFe, the script is
76a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 88ac (spaces mine). This amounts to OP_DUP OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUALVERIFY OP_CHECKSIG. This essentially tells the network to take the provided public key when spending an input, duplicate it, hash the duplicate, compare it and verify that it equals B0D5D1FB94B76B39EE82771027BEFD17131042FA, then check the signature against the original public key (the one you duplicated).
Wallets and explorers will decide which address format to display based on the opcodes in the script. A P2SH address will always start with
a914 and end with
87. A P2PKH will always start with
76a914 and end with
Since Hashing by definition is not a one-to-one function, there is some private key out there for which the pubkey hash would be B0D5D1FB94B76B39EE82771027BEFD17131042FA. However, I'm not aware of any known private key/redeem script pairs that correspond to the same HASH160