On the nature of amorphous-to-amorphous and crystal-to-amorphous transitions under high pressure