The short explanation is that "filk" is music influenced by Science Fiction, Fantasy, Comic Books, and/or related genres. The word "folk" (as in folk music) was misspelled in an amateur-press magazine some years ago, and it stuck.
The word can be used as a noun (meaning the specific song, the entire genre, or a gathering of those singing and/or listening to a performance), as well as a verb (meaning to sing a filk song, or to parody an existing song).
There are as many definitions and philosophies of filk music as there are filkers (those who sing it), and those definitions and philosophies tend to evolve over time. Many filk songs have original words or music or both, but are based on or inspired by a published fictional world, such as Star Trek or Pern or Babylon 5 or Dr. Who or Dorsai or Middle-Earth. Many filk songs are parodies. These can be about nearly any damn thing; a title, or lyric, or turn of phrase, or something can send the songwriter off into directions no one dared contemplate before (and many wish had not been contemplated now).
Filk songs do not have to be related to SF or fantasy. The music of Weird Al Yankovic, and in fact much of the playlist of The Doctor Demento Show, is perfectly welcome in any filkroom in the land. Songs by The Capital Steps are popular in filks, as well as those of Stan Rogers, Christine Lavin, Tommy Makem and the Clancy Brothers, Lou and Peter Berryman, Jimmy Buffett, and many others.