The 1895 Challenge is a reality show where the participants are forced to live as though the year is 1895. The show's premise is apparently to see how well 21st-century people can cope with living in 19th-century conditions.
When the Simpson home was being fumigated to clear out an infestation of Russian termites (making it uninhabitable for six months), the family auditioned to appear on The 1895 Challenge because they would have a place to live if they won. The Simpsons won the audition, beating out Bill Cosby and his family, and appeared on the show.
At first the Simpsons constantly bemoaned the inconveniences of living a 19th-century lifestyle, which delighted the show's producers because the drama made for good television. Later, however, they pulled together as a family and came to enjoy living in the 19th century, which disappointed the producers because their newfound family harmony made for boring television - and, consequently, lower ratings.
In an effort to spice things up and boost the show's ratings, the producers introduced Squiggy into the show as a new character and had him live with the family. When that didn't get the numbers as high as the producers wanted, they next had a flood wash the house down a river and eventually destroy it.
In the end, the Simpsons got revenge on the producers. They teamed up with a number of other abandoned reality show contestants in the woods, who ganged up on the crew and overpowered them, forcing the crewmembers to take them back to civilization.
Behind the Laughter
The 1895 Challenge is a parody of The 1900 House.
The Simpsons beating Bill Cosby is a subtle reference to the scheduling conflict of the early seasons, when Fox moved the timeslot to compete with The Cosby Show. "Squiggy" being sent to boost The 1895 Challenge ratings is another reference to The Cosby Show, whom sent "Smitty" (Adam Sandler) to the Cosby's house.