John Locke's Second Treatise on Civil Government: "Chapters 8-11"

Read Chapters 8-11 of Locke's Second Treatise on Civil Government. In Chapter 8, sections 95-99, how is it that Locke thinks a community or a government is formed? Why does Locke think human beings would agree to this in Chapter 9?