a mediocre analogy would be using a PO Box.
if you published your home address online, in the open (P2PK), and I wanted to break into your property, and steal your stuff, I can just look at your address, and I immediately know where to go, to start my intrusion. (I still actually need to do the work of breaking in...)
In constrast, P2PKH would be like using a PO Box, instead of your actual home address.
I could travel to your PO Box, but even when I get there, I still have a tonne of work to do, to figure out your actual home address. All of that needs to be done, before I can even begin the work of breaking in....