The original cantrips appeared in 1E Unearthed Arcana as follows: "Most cantrips are simple little spells of no great effect, so when the in- dividual becomes a 1 st-level magic-user, the knowledge and information pertaining to these small magics are discarded in favor of the more powerful spells then available. However, a magic-user may opt to retain up to four cantrips in place of one 1st-level spell."
Later editions of D&D often re-worked the original content. So now we have "cantrips" that can be cast infinitely, do 4d6 damage, etc. Why did they do this? I guess it is because the fighter-types can stab with their swords all day long, whereas the low-mid level wizards will otherwise quickly run out of spells in perhaps just one encounter, and then they would have nothing but poor skills with a basic weapon, which is not very magical.