Information regarding where the song came from and what the song is used for are often relevant in fair-use cases. The use of the song should be clearly understood from the context of the situation, and consideration is given to whether the song is used commercially or in a nonprofit manner. Educational reasons for use, such as in a classroom, are most likely nonprofit and not considered malicious use of copyrighted materials.
Fair use often favors those who use only a fraction of a song, such as less than 30 seconds or only a couple of notes or lyrics from the song. Generally, if using the entire song in a situation that results in profit, there will likely be legal issues if you did not receive permission to use the song in a parody first. If only a portion of the song is used --- and not in a way to suggest the use is from laziness or lack of creativity --- it may be found fair by a judge.
The use of the song in a parody should not adversely affect the original creator. Many well-known parody song creators receive permission to parody the entire song from the original artists, which is considered a mutually beneficial arrangement since the parody may bring added attention to the original song, thus increasing sales or popularity of both.
The transformation of the original work in the parody is often a factor in fair use claims. Ideally, the parody use should be minimal, not adversely affect the original artist and present some transformed version of the portion used in an effort to either present a comical version mimicking the original or present some new or innovative piece that only slightly borrows from the original. Transformation, as with other aspects of copyright laws, is fairly subjective; the court has substantial room for interpretation.