The hardness differs from the uni-axial compressive yield stress of the material because different compressive failure modes apply. A uni-axial test only constrains the material in one dimension, which allows the material to fail as a result of shear. Indentation hardness on the other hand is constrained in three dimensions which prevent shear from dominating the failure.