Whyte suggests that Jack was an early pet name for James - probably influenced by the French form Jacques - but now more commonly represents John. However Jack is a synonym for John in Scotland (where Jock is the more usual nickname) and hence appears thus on official documents.
ONC suggests an alternative origin from Jehan, the Anglo Norman form of John, from Hebrew "God has been gracious". Jehanwas shortened to Jan from which the surname Jankin developed. This was contracted to Jack over time, as John was derived from Jehan.
It is possible that the name Jack developed in parallel in Scotland, which was more influenced by French, and in England.
Jack is also now frequently used as a forename in its own right.