While James Madison wrote 29 and John Jay contributed 5, Hamilton's involvement was significantly greater. He was the driving force behind the project, coordinating the effort and contributing the bulk of the content.
The Federalist Papers were indeed published to increase support for the ratification of the United States Constitution.