King William's War was the first of four colonial wars that roughly corresponded to European conflicts, beginning in 1689 and ending when the Treaty of Ryswick was signed in 1697. These wars are sometimes referred to as the French and Indian Wars; in North America, they lasted from before 1689 until the end of the Seven Years War, with brief intervals of uneasy peace in between while European powers rearranged alliances.
In 1685, James II replaced his brother, Charles II, as the King of England. Though the vast majority of his subjects were Protestants, James was a Roman Catholic; he may or may not have tried to convert the entire nation to Catholicism, but in any case that was the reason cited for the unrest that forced him to flee to France in 1688. His daughter Mary and her husband, the Prince of Orange, took over England as joint monarchs in what came to be known as the Glorious Revolution.
The King of France, Louis XIV, was also a Roman Catholic and therefore sympathetic to James' plight. His support led to the outbreak of war between the two nations, with alliances to involve much of the rest of Europe: this was the War of the League of Augsburg. The war spread to the North American colonies -- and also was given its name -- because William refused France's offer to maintain colonial neutrality.
Religious tensions existed in the New World just as they did in Europe. Colonists in New England came mostly from the British Isles, and nearly all of them were Protestants; they had watched with trepidation as New France grew larger and more powerful, occasionally even threatening to encroach on their own territory. The Roman Catholic Church played a large role in the governance of New France; this made the New Englanders suspicious, as some of them were already espousing the importance of the separation of church and state. The French were looking to expand their influence in the St. Lawrence River region into the Ohio Valley -- traditionally an English possession, though later given to the First Nations -- and even further south into the Mississippi Basin, as explored by Robert Chevalier de la Salle. These expansionist aspirations threatened the sovereignty of New England, and worsened the already-strained relationship between the two colonies.
The war began in July 1689, when Louis de Buade, the Comte de Frontenac and governor of New France, initiated attacks on English settlements. The first of these was at Dover, New Hampshire, then a village of fifty inhabitants; Frontenac sent two Iroquois women into the town, who begged for food and an evening's lodging. During the night the women opened the village gates to let in a war party. Half the villagers were slaughtered immediately, and the rest were dragged off and sold into slavery later on. The man who had invited the two women into his home, Major Waldron, was cruelly tortured before he was executed.
A month later, a town in Maine was dealt with similarly. Then came a massacre at Schenectady, New York, then Salmon Falls and Casco. To retaliate, a force under Sir William Phipps was sent to capture Port Royal, an important French harbour in Acadia, in 1690; they succeeded, and the victory prompted another, more ambitious venture. Thirty warships were sent up the St. Lawrence River to attack Quebec, while at the same time an army of more than two thousand men moved overland to attack Montreal.
Neither managed to make any headway, due in part to Frontenac's extraordinarily well-prepared defences and also to Phipps' ineptitude as a military commander. Shortly after returning to Boston with his men, Phipps went to England to seek help; this too was unsuccessful, as the British army was otherwise occupied and William was a strong proponent of colonial independence.
Phipps returned to New England to find that in his absence another series of towns had been razed by Iroquois war parties. More small raids were conducted from then until the war's end, and the New Englanders were powerless to stop them: York, Maine, Durham, New Hampshire, and Groton, Massachusetts were all the scenes of massacres wherein hundreds of colonists were slaughtered. The last such massacre was at Haverhill in 1697, by which point a treaty had been drawn up in Europe.
The Treaty of Ryswick gave all the territory that had been conquered in North America back to its original owners: Port Royal was returned to the French, and the French were forced out of the parts of New England that they had occupied. The treaty was not a permanent settlement so much it was a temporary truce, allowing the powers of Europe to regroup. Less than five years later, the War of the Spanish Succession broke out; in 1702, it would spread to North America as Queen Anne's War.
Sources:
Elson, Henry William. History of the United States of America. New York: The MacMillan Company, 1904.
King William's War. http://www.globalsecurity.org/military/ops/king_william.htm
King William's War. Wikipedia. http://en.wikipedia.org/wiki/King_William's_War
King William's War 1689-1697. http://www.u-s-history.com/pages/h840.html
(All pages accessed 6 August 2004.)
Thanks to Gorgonzola for gently correcting details...