Still largely unexplored, the diffuse light in clusters of galaxies traces the past and ongoing buildup of these massive structures. Here we present the first comprehensive study of the intracluster light (ICL) of the cluster SMACS J0723.3-7327 (z = 0.39) using the JWST Early Release Observations. These deep and high spatial resolution images allow the study of the ICL with a high signal-to-noise ratio up to a radial distance of ~400 kpc, twice as far with respect to previous HST studies of intermediate-redshift clusters. This opens up the possibility of exploring the rich mixture of processes that are building the ICL. We find that the inner parts of this cluster (R < 100 kpc) are built through a major merger, while the outer parts (R > 100 kpc) are mainly produced by the tidal stripping of Milky Way-like satellites. We also find that the slope of the stellar mass density radial profile of the ICL of this cluster (α 3D = -2.47 ± 0.13) closely follows the predicted dark matter halo slope (α 3D,DM = -2.6 to -2), supporting the idea that both components have a similar shape and thus the potential of using the ICL as a tracer of the dark matter distribution in clusters of galaxies. Future JWST studies of the ICL are set to revolutionize our understanding of cluster formation and will be crucial to improve the gravitational lensing mass maps of these structures and thus accurately characterize the properties of the first galaxies.