Many properties in solids are determined by interactions between electronic, magnetic, and phononic degrees of freedoms. Ultrafast pump-probe techniques are ideally suited to access these interactions: they allow observing relaxation pathways of laser-excited solids on femtosecond timescales. These pathways are determined by the interplay of different microscopic interactions. In this thesis, femtosecond electron diffraction was employed to access the response of the crystal lattice to laser excitation. Several technologically relevant materials were investigated: the layered semiconductor black phosphorus, the 3d ferromagnets cobalt, iron, and nickel, and the 4f ferromagnets gadolinium and terbium. Black phosphorus is a layered van der Waals crystal with a narrow band gap and an extraordinary in-plane anisotropic structure. In this work, the ultrafast structural response of the material to laser excitation was studied, in particular the impact of the in-plane anisotropy. Following laser excitation, electron-phonon coupling leads to a highly nonthermal phonon population, which is characterized by a large occupation of high-energy phonon modes and a transient modification of the anisotropy of the atomic vibrations. On timescales of tens of picoseconds, thermal equilibrium of the lattice is reestablished via phonon-phonon coupling. The results presented in this work provide detailed insights into the nonthermal evolution of the black phosphorus lattice following laser excitation and the underlying coupling mechanisms. In addition, the influence of several experimental parameters on the ultrafast lattice response was investigated to identify pathways to control properties of the transient non-equilibrium state. The 3d ferromagnets iron, cobalt, and nickel exhibit ultrafast demagnetization on timescales of hundreds of femtoseconds following laser excitation. Here, three subsystems contribute to the observed ultrafast response: electrons, spins, and the lattice. In this work, the microscopic energy flow between these three subsystems was studied quantitatively. Experimental results for the lattice dynamics were combined with density functional theory calculations and several energy flow models. The comparison of the models with the experimental data unambiguously demonstrates the pronounced influence of the spin dynamics on the lattice dynamics: the combination of energy flow into and out of the spin system leads to significant slowing down of the lattice dynamics. This work shows that energy-conserving atomistic spin dynamics simulations offer a quantitative description of the microscopic energy flow in all three elemental 3d ferromagnets. Furthermore, transient nonthermal states of the spin system were observed in the simulations, showing that thermal descriptions, e.g. with temperature models, cannot capture the full non-equilibrium dynamics in magnetic materials. In contrast to the itinerant 3d ferromagnets, the dominant contribution to the magnetic moment in gadolinium and terbium, the 4f moment, is much more localized. Only a small contribution, the 5d moment, is delocalized. This has consequences for the interaction mechanisms of spins with other subsystems and increases the complexity of the laser-induced response. This work provides detailed femtosecond electron diffraction studies on gadolinium and terbium, both in the ferromagnetic and paramagnetic phases. The diffraction experiments were complemented by time-resolved magneto-optical Kerr effect studies on terbium. Several observations that are at odds with a thermal description of the ultrafast dynamics were identified. This work provides the lattice perspective on the ultrafast response of gadolinium and terbium to laser excitation, which constitutes a basis for a full understanding of the complex ultrafast dynamics in 4f ferromagnets.