King Billy, as he is often called in Northern Ireland, had wrested the British crown from James two years before.
James, a Catholic, rallied forces from Louis XIV of France, along with support from Irish Catholics. William was a Dutch Protestant, thus at the first level it was a sectarian battle between rival religions.
James saw it as a way to reclaim his crown by the backdoor – win Ireland as a base from which to bring war to Protestant Britain.
But at a wider perspective it was also an important battle in the War of the Grand Alliance in which the major European powers, with the backing of Pope Alexander VIII, sought to subdue France, at the time clearly the most powerful nation in Europe.
Had James won the battle it would have had a knock-on effect that could have seen France become the overlord of all Europe. And French may well have become the predominant language.
Instead, William’s forces, by virtue of superior numbers and poor Jacobite generalship, took the day.
James fled to France and though the war went on for a few more months with confrontations in other parts of Ireland, essentially it was all over for Jimmy boy and his French mates. The balance of power on the Continent was maintained.
Wikipedia has a very good article on the Battle of the Boyne. Read it here.