165. It was said in the last chapter (§ 115) that the third voice in a fugue almost invariably entered with the subject. In the very common case in which the subject is in the key of the tonic throughout, the answer will be in the key of the dominant. In order to return speedily to the tonic key, and to allow the third voice to enter at once, we often find in such cases that at the end of the countersubject the leading note of the dominant key is flattened, becoming the subdominant of the tonic key.
J. S. Bach. Wohltemperirtes Clavier, Fugue 33.
Here the subject ends in E; the answer and countersubject are in B. To enable the third voice to enter immediately, a return is made to the key of E at the end of the third bar, by contradicting the A sharp. Where this is not done, it is mostly necessary (as will be seen in the next chapter) to introduce a codetta before the entry of the third voice. The evasion of a full cadence in the dominant key by the device just explained is frequently called by its Italian name, inganno, i.e., "deception"—a deceptive cadence.
166. Sometimes the countersubject is constructed of material suggested by the subject itself, as in the following passage.
J. S. Bach. Wohltemperirtes Clavier, Fugue 18.