Animation has existed since prehistoric times, though it may not've been as complicated as CGI animation. It truly took off during the 19th century. Shadow puppets, magic lanterns, they're types of animation, however, not all cartoons are animations, and sometimes things that are cartoons should really be labeled as anime.
In the debate of cartoons and anime people focus almost exclusively on the cartoons that are shown on the tv but those aren't the only cartoons that exist. The question to ask is what constitutes as a cartoon? What truly separates it from everything else? What 'defines' these animations?
Cartoons are defined by their humor. Even if there's an element of seriousness or tragedy, more often then not they focus on the comedic aspects and highlight them in the shows. Anime on the other hand has a higher focus on character relations and bonds. These interactions between characters are almost always the driving point of a plot.
Cartoons and anime are watched for different reasons, and exist for different reasons. While they have their similarities they aren't the same thing.