Clumpiness of galaxies revealed in the near-infrared with COSMOS-Web. Substructures at 1 < z < 4 and their link to stellar mass and star formation | Synapse