  Magnetic phase transitions are a test bed for exploring the physics of
non-equilibrium phenomena in condensed matter, which become even more complex
when topological constraints are involved. In particular, the investigation of
skyrmions and skyrmion lattices offers insight into fundamental processes of
topological-charge creation and annihilation upon changing the magnetic state.
Nonetheless, the exact physical mechanisms behind these phase transitions
remain unresolved. Here, we have systematically compared ultra-thin films with
isotropic and anisotropic Dzyaloshinskii-Moriya interactions (DMI),
demonstrating a nearly identical behavior in technologically relevant materials
such as interfacial systems. We numerically show that in perfect systems
skyrmion lattices can be inverted in a field-induced first-order phase
transition. The existence of even a single defect, however, replaces the
inversion with a second-order phase transition of defect-induced lattice
melting. This radical change in the system's behavior from a first-order to a
second-order phase transition signifies the importance of such an analysis for
all realistic systems in order to correctly interpret experimental data. Our
results shed light on complex topological charge annihilation mechanisms that
mediate transitions between magnetic states and pave the way for an
experimental realization of these phenomena.
