This was first invented by Robert van de Graaff in 1931. The idea was to build a machine that could accelerate ionised atoms using an electostatic field. It is important to realise that the models used for schools demonstrations are just that - models. They show the principles of operation, but are greatly simplified versions, achieving neither the scale or performance of research Van de Graaff accelerators, which achieve voltages of many millions of volts. One of the largest Van de Graaff generators ever built in air (many modern machines are contained in low pressure vessels to increase the breakdown potential) is now on display at Boston Science Museum, after being used in research at the MIT for many years. It can produce up to two million volts.
The model Van de Graaff generator is a common school demonstration due to its ability to demonstrate many of the principles of electrostatics, and achieve very high voltages, capable of causing electrical sparks to jump several centimetres in dry air. Its operation is explained with the help of the diagram below.

When the motor turns the bottom roller, the friction between the acrylic and the rubber causes the acrylic to become positively charged. This attracts electrons to the tips of the comb A where they collect, and then spray via the action of points onto the belt. The belt carries this negative charge up to the top comb where the same inductive effect occurs, this time the comb tips become positively charged causing positive charge to spray onto the belt and neutralise the charge on the belt. The deficiency of positive charge on the collecting sphere continues, leaving it more and more negatively charged, until the rate of charging equals the rate of discharging to ground from the dome.
Poor operation can result from dirty or dusty components, poor comb positioning (the combs should be as close to the belt as possible, adjacent to each roller, but not touching the belt) or ineffectively slow belt speed. The materials are of some importance. The bottom roller in particular should be able to produce static easily by rubbing.
We have built a machine that generates 20cm sparks, created from parts bought in hardware stores and electrical stores. The dome from some types of ceiling-mounted spot-lights can be used, as these are already spun, and some even have in-turned rims, which is ideal for a Van de Graaff machine. The belt is more difficult to obtain, and is probably best ordered from a science equipment supplier who sells replacement belts for commercial machines. The base roller can be made of acrylic (perspex) which will charge positively, giving the rubber belt a negative charge. If polythene is used, then the belt, and hence the dome, will receive a positive charge. The top roller could be anything, but is probably better to be fairly anti-static in nature, since static electricity produced at the top roller should not contribute to the proper running of the machine. The supporting pillar should be strong and insulating - not wood. Acrylic or turfnol are good choices, or ABS, PVC would do also. In our model, the bottom roller is motor driven, and this motor is controllable both in duty cycle for accumulating controlled doses of charge to the dome, and in speed for adjusting the peak voltage accumulated at the dome. Our dome is 25cm across and the machine is about 1m high. The discharge sphere is slightly smaller but doesn't have to be, and is connected to earth. The combs of the machine which are placed close to, but not touching, the belt at the top and bottom roller, are made from around forty equal length pins soldered to a piece of 1mm thick tinned copper wire.
There are many experiments that can be done with the machine. The capacitance between the top terminal and ground is tiny - only around a few micro-coulombs. Thus even although an extremely high voltage V can be generated, the stored charge Q is low, according to Q = CV. In principle the top electrode capacitance can be increased, by connecting is in parallel with Leyden jars for example, but the discharging rate almost certainly suffers, and although C is greater, V then reduces, causing Q to increase, but not by the factor you might expect. However the stored energy in these jars goes as the square of V, and is certainly notably greater than that stored in the field around the top sphere alone. This makes the discharge from a Leyden jay quite impressive but also rather dangerous. The capacitance of a typical large Leyden jar is a few nano-farads, so stores around 1 joule of energy when charged from a modest Van de Graaff generator. A pair of discharge tongs is strongly recommended.
Of course, another way to increase the capacitance of the machine is to use the human body connected to the dome, as is done with the volunteer standing on the plastic bucket having his or her hair standing on end. A spark drawn from such a person to ground will always be more intense and painful than if the same person were to simply stand on the ground and point to the dome drawing a park that way.
The electric wind can be demonstrated by attaching a needle to the dome and getting it to point at a candle flame. The candle flame should clearly be seen to dance in the wind. For large machines producing more than 150,000V or so, the candle can be placed as far as 1 metre from the needle, although the effect is different between Van de Graaff generators producing positively and negatively charged domes. The needle is spraying ions (or electrons) from its point and these apply a force to the positive ions produced in the flame, causing the flame to move and interfering with the convection currents, thus making the flame wander randomly.
Hamilton's mill is another demonstration of charge spraying off points. The mill takes the form of a small pivoted vain ending in spikes pointing against one direction of rotation. When the vain becomes charged, the spikes spray charge and the reaction produces rotation of the vain. This demonstration works better with a positively charged dome since the ions have more effective momentum and produce a bigger reactive force.