Theoretical key
A piece of Western music usually has a home key, and a passage within it may modulate to another key, which is usually closely related to the home key. (Usually, close to the original around the circle of fifths.) When the key is near the top of the circle (a key signature of zero or few accidentals), the writing of both keys is easy- a small number of extra sharps or flats is added.  But if the home key is near the bottom of the circle (a key signature with many accidentals), enharmonic equivalence may need to be used because simply adding accidentals will result in a key with too many accidentals to be easy to play or write in.