Gene and Phineas have a close but complicated friendship. As told from Gene's perspective in The Separate Peace, Gene spends much of the story struggling to understand what he truly feels about Phineas and why he feels that way. His feelings change often as experiences reveal new layers of their relationship.
Phineas is a natural athlete and a charismatic leader among their classmates and friends. Gene envies the athletic ability he can not equal - teenaged boys in that setting (and most humans, in most settings) don't like to be beaten.
However, Gene is the better student, and he consoles himself with his superiority in that area. When Gene understands that Phineas can accept, and indeed expects, Gene to achieve superior marks, his sense that their relationship is balanced is deeply shaken.
He had never been jealous of me for a second. Now I knew that there never was and never could have been any rivalry between us. I was not of the same quality as he. I couldn't stand this.