Such a complicated topic deserves lengthy discussions.
My fragmented knowledge won't do justice to it. The Internet would be a better place. Here is a NPR piece:
http://www.npr.org/2011/05/20/136495202/background-israels-pre-1967-boundaries
Another: