How HSM stores keys securely when we say that HSM  stores keys securely we mean that non-authoriszed requester cannot access the keys.

but the key is stored physically anyway in the hardware, so access is still possible

if the keys are encrypted, that means that there is another key in the hardware that encrypted those keys. this key is not encrypted then !!

I'm confused
The key is stored physically anyway in the hardware, so access is still possible


The assumption is that it is practically impossible to read the keys that reside (permanently or temporarily) inside the HSM. They will be present in usable form, and used, only inside the HSM, and it is the HSM's job to protect these keys (including enforcing restrictions about what can be done with them).

Preventing access to information stored and processed in the HSM (and deliberate interference with that processing) is accomplished to some useful degree by physical barriers that prevent connecting probes to the insides of the HSM. There are sensors intended to detect if these barriers are pierced or operating conditions otherwise not normal, checks to detect incorrect processing... In such case, the HSM typically attempts to destroy the keys and data being processed, so that there is no longer anything useful that can be extracted.

Additionally, it is often insured that the keys are just not there (thus can not leak) unless there is good assurance that the HSM is operating under rightful conditions (for example, it might be necessary to reunite several partial keys, some in Smart Cards under control of security officers and protected by a PIN code with counter, in order to obtain and use the actual keys inside the HSM).


  If the keys are encrypted, that means that there is another key in the hardware that encrypted those keys


Yes. That's typical.