A Sonata is a musical composition of several contrasting movements for one or two instruments. A symphony is a sonata for orchestra; a quartet is a sonata for four instruments and a concerto is a sonata for solo instrument and orchestra.
The term sonata form or sonata-allegro form refers to the design or plan frequently used in the first movement. It has three main parts: exposition, development, and recapitulation. Each of these main parts has sections arranged according to key relationships. The EXPOSITION, in which the composer’s ideas are first exposed, may start with a brief introduction, but usually goes right into the first theme in the Tonic Key. Sometimes more than one theme is heard, but all stay in the Tonic or home Key. A bridge or transition (which is optional) leads to the SECOND THEME (or themes) in a closely related key (normally the Dominant, but if the home key is minor, the Relative Major). Next there may be a series of short episodes, or a closing theme, or both, ending in a final cadence in the new Key. This is where the double bar with repeat marks is found leading to the:
DEVELOPMENT, using themes from the Exposition, varying and combining them, and modulating quickly through different Keys, usually by a series of sequences. The last part of the Development stresses the original Dominant bridging over into the:
RECAPITULATION, which repeats the same material heard in the Exposition in the same order. This time, however, all of the material stays in the original Tonic Key. Sometimes a Coda usually based on previous themes, is added at the very end.
The overall tonal plan may be compared to a journey: in the EXPOSITION one spends a little time in the home state, such as Iowa, (Tonic, or home Key: FIRST THEME (s)). Then one goes (transition) to a bordering state for a while (Related Key: SECOND THEME(s), episodes, closing theme). In the DEVELOPMENT one passes through several states, spending only a short time in each; the last one (Dominant) is again a border state. In the RECAPITULATION one spends all the rest of the trip in the home state (Tonic).
In a Sonatina or a short sonata some of the sections may be omitted (this does not necessarily mean that it is technically easier than a longer sonata, however).
Most keyboard sonatas have three movements. The second movement is usually slow and lyrical. The third movement is often the fastest of the movements and may end in a fanfare and climax. Many third movements are written in Rondo form.
As you listen to a sonata you may find it interesting to analyze its form to further appreciate this type of musical work.