While the stories behind the The Simpsons Halloween "Treehouse of Horror" episodes may seem simplistic and easy to sum up (Mr. Burns is Dracula, Lisa is Harry Potter, Homer clones himself ala Multiplicity), the writers typically find these episodes to be exhausting and difficult to write, and as such the ToH episodes are usually produced a year ahead of time (meaning that the Halloween 2001 episode was produced in 2000, and so on). This extra time gives the writing staff and animation team a chance to perfect the show, as much of the animation can be quite complex (such as the time travel animation in "The Fright to Creep and Scare Harms" segment). Sometimes ToH segment ideas stem from cut segments of a traditional episode of The Simpsons that were deemed too over the top, such as a gory shooting or tragic accident.

The ToH episodes must conform to these rules:

  • The episodes do not exist in the normal continuity of the show. If you were ask the real Bart Simpson about his exploits, he'd have no memory of raising the dead or owning a cursed talking Krusty the Klown doll.
  • Because of the lack of continuity, anything is possible. Furthermore, often times because the events in a segment will never be followed up on, most times backstory behind what prompts the segment is often glossed over ("Oh, we won a new house" or "The frogurt is also cursed". Basically, whatever is presented we, the audience, should just accept and go along).
  • Kang and Kodos, the aliens, must appear in every ToH episode. Often times the writers forget to include them, which is why in many ToHs you'll find them in a bit part at the very end of the final segment. Moreover, Kang and Kodos do not exist in the show's continuity which is why they can only appear in ToH episodes or clip shows.
Early ToHs were considered by the writers to be somewhat scary and, out of fear they'd scare their younger viewers and prompt angry letters from parents, the writers tacked on a brief intro where Marge would warn that the following episode was very scary. However, as the years went by the writing team realized that the ToHs were actually tame in comparison to other entertainment running in the same time slot, and the warnings were dropped. Furthermore, early ToHs also included an overall connecting device between segments (such as "too much Halloween candy causes bad dreams" and the dreams are the segments). As time went by the writers began running out of ideas for these connecting threads and the concept was dropped. Recent ToHs simply contain three segments seperated by commercial breaks. The same can be said for the novelty tombstones that were featured in early ToHs: they just became too hard to write and were eventually dropped.

New ToH episodes typically air after Halloween on FOX (and are not considered season premieres by the network) due to conflicts with World Series baseball, while in syndication ToH reruns usually air in the two weeks before Halloween.


References:
http://www.snpp.com
The Simpsons Complete Second Season DVD