Most tonal pieces start in the “home key” — the “tonic,” as musicians call it — and return to it in the end. But occasionally we find a piece that seems to start in one key and then ends on a different tonic. Theorists call it “directional tonality” or “progressive tonality” (wikipedia).
A good example is Chopin’s Ballade No. 2, the so-called “F Major Ballade,” which seems to start in F Major, but ultimately, after some back-and-forth, ends in A Minor. If a thing is defined by its destiny, this piece should properly be called the “A Minor Ballade.” This performance is from a recital I presented in Atlanta in 1988.
The same tonal motion is replicated in the piece as a whole, which moves from E-flat major to a C minor ending with tragic overtones.