This work studies the relaxation dynamics of molecules in both the gas and liquid phases after strong field ionization, using transient absorption in the soft X-rays. In particular, the thesis presents the first realization of time-resolved X-ray absorption spectroscopy in the spectral water window with a laser-based HHG source. These remarkable experiments were not only performed for isolated molecules, but also in liquids, for which the spectral coverage of the K-edges of C, N, and O are of primary importance for investigating biological molecules. The technique relies on the generation of high-order harmonics to further probe the electronic structure of molecules. Using the atomic selectivity of high energies and the temporal coherence of laser technology, we demonstrate the observation of the first stages of chemical transformation of matter in the gas and liquid phases.