We present a comprehensive study of jet substructure observables in pp and PbPb collisions at \(\sqrt{s_\text {NN}} = 5.02\) TeV using a multi-phase transport model. To suppress background contamination, the constituent subtraction method was employed for both PbPb and smeared pp events. The jet splitting momentum fraction ( \(z_\text {g}\) ) and the ratio of the groomed jet mass to the ungroomed jet transverse momentum ( \(M_\text {g} / p_{\text {T},\text {jet}}\) ) were reconstructed using the Soft Drop algorithm with two grooming parameter settings. With \(z_\text {cut} = 0.1\) and \(\beta = 0.0\) , a slight modification in the \(z_\text {g}\) distribution is observed in central PbPb collisions, whereas a pronounced enhancement in the high \(M_\text {g} / p_{\text {T},\text {jet}}\) region is found, particularly at low \(p_{\text {T},\text {jet}}\) and in more central events. A detailed analysis of the dynamical evolution stages revealed that this enhancement primarily originates from jet–medium interactions, whereas the contributions from hadronization and hadronic rescatterings are largely mitigated by the grooming procedure. In contrast, under a stronger grooming condition ( \(z_\text {cut} = 0.5\) , \(\beta = 1.5\) ), no significant changes in \(M_\text {g}/p_{\text {T},\text {jet}}\) are observed, indicating that the medium-induced modifications are predominantly associated with large-angle scattering within the AMPT framework.