rock, crag, boulder
巖 centers on a large, rugged rock formation: a crag, boulder, or imposing rocky cliff.
巖 combines 山 (mountain) with 嚴, which likely contributes the sound and the idea of something severe or imposing, together suggesting a steep, severe rock face.
The top 山 is a mountain, and the bottom 嚴 looks like a severe, jagged cliff face. Picture a towering, rugged crag that dominates the landscape.
For ガン, imagine a gun being fired at a huge boulder, but the rock is so solid it just bounces off: gun -> ガン, and the boulder stands firm.