Like many peculiarities of American English, cookie is a byproduct of the Dutch presence in New York.
The Dutch colony of Nieuw Nederland used Dutch as a lingua Franca, but from the very beginning the Dutch were a minority in their own colony. While the British and Spanish could hardly restrain the huge numbers of impoverished Britons and Spaniards chomping at the bit to try for a fresh start in the new world, the Dutch were in some ways victims of their own success. The Netherlands of the 1600s had the highest standard of living for the middle and working classes anywhere in the Atlantic world. English visitors would enquirer what nobleman lived at a certain fashionable address, only to learn the householder was a craftsman or minor merchant. Amsterdam boasted poorhouses that an English visitor described (almost certainly with some exaggeration) as “more like the palaces of princes than houses for the poor.”
The upshot of all this was that the Dutch West India company had to look to the margins of society to find people willing to abandon the comforts of the Low Country for an uncertain future across the water. One obvious source of labor was the French-speaking population of Huguenots and Catholics in the extreme south of the country (today’s Belgium) who made up the lion’s share of early colonists. The population of Nieuw Nederland in general and Nieuw Amsterdam in particular quickly became a motley assortment of Dutch, French, English, Scots, Scandinavians, Jews, Turks, West Africans, Indians, Native Americans of various tribes, Germans, and just about every other nationality present in the Atlantic world. All these people communicated in a Dutch-based creole that borrowed freely from their native languages and exhibited a remarkable degree of lexical fluidity.
Of course, it did not last. Before the century was out, Nieuw Nederland was annexed by Britain and partitioned into the states of New York and New Jersey. English quickly came to supplant Dutch as the street language in most of the territory, but its legacy survived. The exposure to New York Dutch is responsible for many of the differences in vocabulary that set early American English apart from British English - consider the word boss (from the Dutch baas), which early Americans eagerly adopted as a more egalitarian alternative to master, and which is still far more common in the daily speech of greater New York than the rest of the country (you want cheese on that Boss?).
As for cookie, the etymology is fairly simple. It comes from the Dutch koekje, meaning any small baked good, which is much what the English biscuit meant at the time.
It is a repeated pattern in the evolution of language that, when two languages combine, their respective words for a single thing take on subtly different meanings in the new language. Consider how the collision of the Germanic grape plum sheep pig and the Romance raisin prune mutton pork after the Norman invasion gave English new shades of meaning that both Anglo Saxon and Norman lacked: where before they would have to say “grape and dried grape” or “sheep and sheep meat,” there was now an easy way to distinguish base materials from refined products. Much the same happened with koekje and biscuit - early Americans, famous for their sweet tooth, split the single concept of “small baked thing” into “small sweet baked thing” and “small savory baked thing.”
We owe the Dutch a debt of gratitude for much of the expressive richness of American English, as well as its egalitarian character that shocked British prescriptivists from the 1700s to the present day. That, and cookies.
Sources:
The Adventure of English Melvin Bragg, 2003
The Island at the Center of the World Russel Shorto, 2004