Homebrew came to the gaming lexicon early on from our friends in the SCA who were brewers (as it was told to me).
In short, you take the basic components provided in a brew recipe and add your own touches by adding/ deleting ingredients or altering the proportions slightly. So a brewer can either do massbrew, recipe-it, or homebrew.
Now extend this to gamng.
Massbrews are the published game settings with no deviations.
Recipe things are combining the raw elements presented and generating something pretty much like everyone else.
Homebrew is do it yourself. In the begining, you would take an existing world (like the DnD standard) or game (AD&D was the normal system of choice at the time) and change things around enough to make it your own, your own homebrewed world or game. The phrase has been extended to those who are making their own unique games or world.
<rant/>
Can I just say I have a total loathing for the term Homebrew. I feel it cheapens the efforts of people who go to the effort to make their own game materials. It allows you to disreguard it with distain by a simple "oh it is some homebrew". After all, it is not OFFICIAL or PUBLISHED material, so it must be crap. Yet, we all know some of the best game worlds and systems we have encountered were made by gamers we have met, not publishers.
I could go on by I am shutting up now.
</rant>