Wool is a natural protein fibre meaning it grows in its fibrous form, from sheep. It's basically sheep hair - to produce yarn it's simply clipped from the animal, cleaned, combed and twisted together. It is still hair, so it has the insulating and 'weather proof' properties that animal hair does.
It biodegrades, takes almost all dyes including natural plant dyes and comes in numerous textures and properties. You can also take wool from goats (cashmere) rabbits (angora) camelids (llama, alpaca and camel) and even some cattle (yak, which is DIVINELY soft!).
However being naturally produced it is labour intensive and a finite resource and there are animal welfare issues, particularly with angora rabbits. Quality is also very variable because of these factors.
Polyester is is the brand name (iirc) for a type of acrylic fibre made from petrochemicals (oil) - it's essentially plastic. It's made by chemically altering and shaping the liquid (mostly by extrusion) to form solid fibres, which are then twisted in the same way wool is.
This chemical processing, plus the need for pretty intensive dyes, often creates environmental and humanitarian problems. Coupled with the fact that it does not biodegrade and is difficult to recycle, many crafters avoid it entirely.
It is however loved by many for its cheapness, repeatability (there is little variation between one batch of a yarn and the next) and massive variety - manufacturers had found ways to replicate almost every type of fibre in existence and in every style imaginable, from a sequinned mohair style to the ribbon type 'fashion' yarns.
It is also often the best choice for many with wool/animal allergies, and is hardier than animal fibres and is almost always machine washable. It will however ALWAYS pill, and often 'grows' on laundering.
Interestingly the title acrylics covers any processed yarn, and they come in a remarkable array of base materials, inclusdingand crossing over with Cellulose (plant based) fibre. These include wood cellulose (rayon) seaweed (seacell) sugar, banana and milk (casein). These all produce silkier yarns than oil, and while they can still include chemically intensive manufacture, they can be an exciting and eco friendly alternative to fossil fuels.