Infall and accretion of substructure in hydrodynamical simulations of galaxy clusters