Contrary to what has been said it is not true that compression does not increase strength in certain substances, and that adding stress will only bring a substance closer failure. Pre stressed concrete is a perfect example of a substance that gains strength from compression. If you are unfamiliar with the process, it is where concrete is poured in a mold with cables running the length, these cables are stretched and when the concrete is dry they are released, thus putting the concrete under stress. Cocnrete has very high compression strength and very low tensile strength. So yes, in a way you are bringing the concrete closer to its compression fail level but taking it further from its tensile fail level, which is a good thing since concrete will in all probability never even come close to its compression fail level. For all intents and purposes, compression makes concrete stronger.
Another example of compression increasing strength is in the forging process, where a piece of metal is heated and then a pressure is applied forcing it into shape. This results in the metal being stronger than through the cast process(molten metal poured into a form) because the pressure aligns the grains of the metal, which adds strength to the piece.
As to how compression might help a buildings stability, if the ground is compressed, it will increase the force needed to compress it even more, thus making that plot more stable and less likely to settle. But as far as I know, and my knowledge in this area is limited, most homes are built on solid ground, and if the ground isn't solid, the loose material is removed and replaced with something more solid, ie replacing sand with dirt/clay. and there is not much compacting. Not sure what they do for bigger structures.
to answer your question, the relationship between compression and strength depends on the material. some materials will lose strength from being compressed, others will gain. in some Materials there is an increase in strength from an added stress.