Cadences come in varying strengths. The strongest, called a Perfect Authentic Cadence is required to end a piece--or even a significant section of a piece--in the Classical Era. Even after many years as a performer I was surprised to hear this stated so firmly by a theorist and even more surprised to discover he was correct. It is simply not the case that composers often used cadences to end pieces in the Classical Era--no, pieces HAD to have a solid cadence at the end.
A cadence is more than mere punctuation. Every sentence in prose writing normally ends with a period, but in music phrases may end in various ways, sometimes with, sometimes without a cadence. Also, cadences come in varying degrees of strength from ones that are very solid indeed, to ones that are deceptive, leading not to the home chord or tonic, but to some other chord. In those cases the cadence does not close off the music, but leads it on. Cadences in some form or another have been used ever since mentioned by Guido of Arezzo around 1026. We can see how cadences work in just one phrase of a piece by Haydn. Here is the opening of his Piano Sonata in E flat major:
|click to enlarge|
Here are the first nine measures of the piece. The first phrase ends on the first beat of the ninth measure, which is also the beginning of the next phrase. Now look at the smaller sections. The first two measures begin and end with an E flat chord, but there is no cadence. The next three measures move to a B flat chord, known as the dominant and with some faster moving ideas, end up, in measure six, on a new chord: C minor. Measure eight ends with two separated chords, an F minor followed by a B flat with an added 7th (the A flat note). These two chords, followed by the E flat chord that is the first beat of measure nine, create a Perfect Authentic Cadence which is the dominant (B flat, prepared by the F minor chord) followed by the tonic (E flat) both in their strongest form. In microcosm, this is how classical harmony works. No matter what the first chord might be, until we have the full cadence of measure 8 to 9, we have not defined a tonality. Here is a performance of the piece so you can hear how this works:
If you learn to listen for cadences, it will clarify the musical form for you.