At the beginning what is Ralph's attitude towards Jack?
Ralph, a logical being, was willing to be friendly and helpful with all his fellow shipwrecked mates. He did not intend to be in conflict with Jack, and was actually a little surprised that the boys voted him leader over Jack at first. His natural leadership qualities won their confidence and affections as leader of the group especially since he and Piggy had the conch shell at the beginning of the novel. Ralph was a congenial boy--well-liked and likeable. He made friends easily with everyone. It wasn't until his agenda and Jack's clashed that trouble began for him and those who sided with him.
In addition, Ralph is relieved to meet Jack and responds well to Jack's irreverant and cheerful behavior. After listening to Piggy talk about scary and realistic things like food and rescue, Ralph finds Jack youthful exuberance and natural confidence to be reassuring. He and Jack share meaningful looks, eye-rolling really, over Piggy's more uptight and annoying behaviors. Ralph feels accepted by Jack and takes to calling Piggy by his nickname when Jack does. Without Piggy around, Ralph may have easily abandoned his morality and been swept up into Jack's gang.
Initially, Ralph is very taken to Jack as both boys were the eldest of two choir groups. They both have mutual respect for each other - Ralph was intrigued by Jack's confidence and natural leadership skills. He even joined Jack in teasing the younger boys, probably with the intention of being "accepted" by Jack.
The author depicts Jack as the natural leader of the group but Ralph, due to certain qualities, was picked by the boys on the island. Perhaps this caused a little animosity between the boys.
Only when Jack begin taking the "older boys" on their hunts, did the two clans separate, leaving Ralph to tend to the younger boys, as well as Piggy, whose intellect complemented Ralph's leadership skills. Here we can see that the author still found shortcomings in Ralph and required to keep Piggy as a close ally to him.
Maybe the storyline would have been different if Jack had been picked as the leader of the group to begin with - as implied by Ralph's initial admiration for Jack.