A ping never makes it to the physical layer (layer 1). The ICMP message is generated at the newtwork layer (layer 3) (I think), sent to the data link layer (layer 2). Layer 2 turns it around and sends it back to layer 3 before it ever hits the hardware.
A failed ping to localhost (127.0.0.1) indicates a problem with either the IP protocol or one of its components, or a problem with layer 2, which is generally ethernet. Has absolutely nothing to do with the physical layer (hardware) as the loopback is a virtual device, there is no physical layer involved. Could be a bad configuration or a corrupted driver.
A failed ping to an address belonging to the host in question also indicates a problem at layer 2 or 3. Difference is that it could be the result of a layer 1 problem, not because layer 1 is directly involved, but because layer 2 and those above are dependent upon a existence and proper function of a device. If the physical or virtual device is not present or is not functioning properly, it may not allow the higher layers to load or it may disrupt their function.
You should also note that a good ping to either local address does not indicate a good physical connection. It is entirely possible that the layers involved are loaded and functioning with a problem at the physical layer.
That was the long answer. Short answer, if a ping to localhost fails, it generally would indicate a problem with TCP/IP or the layer 2 service (ethernet). If a ping to an external address assigned to the host fails after a successful ping to localhost, it generally indicates that there is a problem with the device that has holds that address. It does not necessarily indicate a hardware problem, although a hardware problem could be the undelying cause.
Guess that one wasn't all that short either. Oh well, hope some of it makes sense.