The Israelis occupied the West Bank because Israel was attacked.  In 1948, instead of declaring independence, the West Bank asked for & were granted union with Jordan.  In 1967, the Jordanian army containing Palestinian soldiers attacked Jewish residential areas.