It was more of a coup than an invasion, if I remember, right?
Mary was the daughter of James II and until the birth of a son, the heir apparent. Her husband, William II of Orange, was also in the succession, a grandson of Charles I.
A group of English notables issued an invitation to William and Mary to take James' throne and William arrived with a Dutch army. There really wasn't a war; William's strategy was to occupy friendly towns willing to declare him King and play for time while James' regime disintegrated. It worked and James fled to France. Parliament then declared William and Mary monarchs.