Pressure dependence of the electronic and crystal structures of K$_{x}$Fe$_{2-y}$Se$_{2}$, which has pressure-induced two superconducting domes of SC I and SC II, was investigated by x-ray emission spectroscopy and diffraction. X-ray diffraction data show that compressibility along the c-axis changes around 12 GPa, where a new superconducting phase of SC II appears. This suggests a possible tetragonal to collapsed tetragonal phase transition. X-ray emission spectroscopy data also shows the change in the electronic structure around 12 GPa. These results can be explained by the scenario that the two SC domes under pressure originate from the change of Fermi surface topology. Present results here show that the nesting condition plays a key role in stabilizing the superconducting state helping to address outstanding fundamental question as to why the SC II appears under pressure.