  Compounds with a tetragonal ThCr$_{2}$Si$_{2}$-type structure are
characterized by the possibility of the isostructural phase transition from the
tetragonal phase to the collapsed tetragonal phase induced by the external
pressure. An example of a compound with such a phase transition is
KFe$_{2}$As$_{2}$, which belongs to the family of the iron-based
superconductors. In this paper, we investigate the effects of the phase
transition on the structural, electronic, and dynamical properties of this
compound. Performing the ab initio calculations, we reproduce the dependence of
the lattice constants on pressure and analyze the changes of the inter-atomic
distances in the tetragonal and collapsed tetragonal phases. Using the tight
binding model with maximally localized Wannier orbitals, we calculate and
discuss the influence of pressure on the electronic band structure as well as
on the shape of the Fermi surface. We found a precursor of the phase transition
in the form of enhancement of overlapping between two Wannier orbitals of As
atoms. In order to better understand the superconducting properties of
KFe$_{2}$As$_{2}$, we study the orbital-projected Cooper pairs susceptibility
as a function of pressure. We found a decrease of susceptibility with the
increasing pressure in a good qualitative agreement with experimental
observation. The structural transition also influences the phonon spectrum of
KFe$_{2}$As$_{2}$, which exhibits pronounced changes induced by pressure. Some
phonon modes related with the vibrations of Fe and As atoms show an anomalous,
nonmonotonic dependence on pressure close to the phase transition.
