Sonata was developed in the Classical period and is very similar to binary form. Binary form came first and consisted of two parts that complemented each other. With the advent of the sonata form, the second part was developed further in order to express more complex musical ideas. Binary form was fine for short pieces, but it didn't allow the type of development and resolution that sonata form allowed for.
The exposition is the opening section of the sonata form. It is based in the tonic, and the goal is to present the opening melodic material that will guide the piece. There are two ways of thinking about the exposition. An older theory states that the melodic theme is what is important, and the main themes form the basis for analysis. Today, the exposition breaks up into key areas: with a primary and secondary key area introduced in the opening section. In this way, there are two themes in an exposition. The exposition was repeated to firmly instill the home key in the listener's mind.
The development section is where the piece begins to move through several different key areas, developing the ideas started in the exposition. The development is the start of the second part of sonata form and continues into the recapitulation. The development often goes through a series of modulations before coming back to the home key in the recapitulation.
The recapitulation is the end of the piece. It is in the home key and often presents the same material as the exposition. This return to the home key is crucial in Classical sonata form. It symbolizes a return to home and a restoration of order that was so crucial in the Classical period. The main difference between this section and the exposition is that the secondary key area never comes. The recapitulation stays in the tonic until the end, firmly establishing the primary key area of the piece.