Agriculture developed in separate locations worldwide about 12,000 years ago, at the beginning of the current geological epoch. Different explanations exist, drawing on the unusually stable early-Holocene climate and humanity's psychological aversion to death, among other factors.
In all locations, the domestication of plants helped justify establishing trade and building permanent structures. The Agricultural Revolution enabled humans to produce non-instructional art and to live in groups in excess of five hundred. People acclimated and hybridized an unknowable number of plant strains in the following centuries; plant genes diversified in response to human culture.
Today, the development of regional varieties and the preservation of genes falls mostly to home gardeners. In the last century, the number of commercially-available seed varieties has fallen by ~90%. Saving seeds carries legal ramifications which are easily ignored.
Pollination, Annuals, Biennials, and Perennials
The terms "heirloom" and "open-pollinated" are often used interchangably. Heirloom seeds are the result of careful breeding, usually to enhance particular features; open pollination refers to how a plant takes pollen. Open pollination enables the creation of both heirlooms and hybrids.
Annual plants complete their life cycles in one growing season; generations are bridged only by dormant seeds. Most plants consumed today are annuals. As regards saving, species of annual seed can be divided into three levels of difficulty: a) self-pollinating; b) open-pollinated; c) biennial.
Tomato, pepper, bean, and pea are all self-pollinating, with a stamen and pistil within each flower. Your main advantage to not requiring a different plant for fertilization is that there is little danger of cross-pollination--or, pollination by a different variety of the same species. Cross-pollination is how hybrids are created.
Self-pollinated seeds require little in the way of precaution--so long as different varieties are more than a few feet apart, cross-pollination is unlikely. Tomato seeds are comparatively difficult to save because their gel coatings must be fermented away prior to storage. This is achieved by leaving the seeds in water and skimming them off and drying them when mold appears.
The flowers of open-pollinated plants are sexed, containing either a stamen or pistil. Their pollen is carried by wind and living things; open-pollinated plants are often pollinated by different individuals.
Squash, pumpkin, and corn are all open-pollinated. To achieve controlled breeding, one moves pollen from one plant's male flower to the stigma of another plant's female flower. If you wish to be organized, you may mark pollinated flowers with zip ties. It is best to take/give pollen from/to the hardiest flowers on your hardiest plants. Corn genes are particularly hard to keep pure because its pollen is wind borne; its tassels should be covered with plastic following pollination.
Biennial plants follow a two-year life cycle, producing vegetation in the first year and seed in the second. Comparatively few plant species are biennial. Examples include onion, parsley, cabbage, carrot, beet, and foxglove. Biennials must experience vernalization, or a prolonged period of cold temperatures, before flowering.
Perennial plants live a number of years, flowering each year after achieving sexual maturity. Perennials are usually propagated by division because their seeds can be troublesome to germinate, often requiring cold stratification (similar to vernalization) in order to grow. Easier perennial seeds tend to be available for purchase.
Some annual plant species growing in very favorable conditions can live through more than one growing season, whereupon they are considered perennial. Perennial tomatoes and peppers are common in temperate climates.
A Very Little on Hybrids
Plant hybrids are produced by cross-pollination. They are natural and necessary. Whether a hybrid grows true-to-type depends on that hybrid's generation.
First-generation hybrids, or F1s, tend to look much like their parent plants. This is because most seed comes from inbred lines, a consequence of self-pollination and careful breeding. The term "hybrid vigor" applies almost exclusively to F1s, which tend to display their parents' best characteristics. Commercially-available hybrid seed is F1.
F2 seeds are produced by F1 plants, whenever F1 plants are not sterile (commercial hybrids almost always are). F2s frequently do not resemble their parents because of the emergence of recessive genes, suppressed by those years of breeding. It can indeed take an entire generation to find out you've allowed your peppers to cross-pollinate. F2 plants demonstrate in a poignant way how genes lock into one another and can be selected to breed new cultivars, given enough time, available earth, and frustration tolerance.
Note that hybridization is not the same as genetic modification, which involves physically manipulating genes in a lab.
Culling & Storage
In February 2012, seeds recovered from permafrost on the banks of the Kolyma River, frozen there for 30,000+ years, produced white flowers similar to milk vine in a Russian laboratory. The scientists bathed the seeds' placental tissue in sugars, vitamins and growth factors; the solar energy and carbon responded, unfolding into roots. It's an astonishment to be sure, overtaking its closest competitor--a phoenix palm coaxed from 2,000-year-old seed--by a literal order of magnitude.
The last process in a seed's development is the hardening of its shell, which ususally coincides with plant/flower death. Seed production requires much energy and nutrient. To ensure viable seed, It is best to harvest from dead plants or very mature fruit. All seed should be washed, dried completely, and stored in a cool, dark place. Be sure to separate seeds and label them with pertinent info--year, variety, and generation/genetic source if applicable. Boxes for recipe cards or ammunition work well.
Most properly-stored seed keeps for a number of years. Rates of viability will decrease over time, particularly in alliums (onion, garlic, and the like); these tend to drop off after the first year. A good off-the-top way to determine how long a seed will keep is to determine how long the seed tends to stay dormant in the wild. Cactus seeds keep longer than plantain seeds, for example.
Cull early and hard; save only the largest, fullest seeds from your strongest plants. This process is responsible for the countless heirloom varieties in the world. Over time, saving and planting your own seed makes plants that grow best in your soil, in your weather, and with the amount and angle of your sunlight.
Diane Linsley, "Saving Flower Seeds." Diane's Flower Seeds. http://www.dianeseeds.com/saving/flower.html, 10/13/14.
University of Minnesota Extension, "Saving vegetable seeds: tomatoes, peppers, peas and beans." http://www.extension.umn.edu/garden/yard-garden/vegetables/saving-vegetable-seeds/, 10/13/14.
International Seed Saving Institute, "Basic Seed Saving." http://www.seedsave.org/issi/issi_904.html, 10/13/14.
Discover Magazine. "Flowers regenerated from 30,000-year-old frozen fruits, buried by ancient squirrels."
Susan Okie, The Washington Post, rpt. The Los Angeles Times. "Archeologists Date Farming in N. America to 2000 BC : Prehistory: Evidence suggests the early aboriginal peoples of eastern North America were more advanced than believed, and that the area was one where agriculture developed independently."
National Geographic, "Our Dwindling Food Variety."