A shed is generally a modest, single-storey structure, usually constructed of wood in a back garden or on an allotment, used for storage and as a workshop and very often as a retreat in which to relax and pursue hobbies, especially gardening and small engine tinkering.
The word is recorded in English since 1481, as shadde, possibly a variant of shade, the root meaning being shelter.
Sheds can also be auxilliary buildings in larger complexes, such as military barracks which may include a vehicle shed and/or in mounted units a forge and shoeing shed in a detached block near the troop stables.
In Australia and, particularly, New Zealand a shed is also any building, of any construction or size, that is not a residence and that may be open at the ends or sides, or both.
A popular style for smaller storage sheds have a gambrel-style roof, which resemble a Dutch-style barn, and the high sloping roof line increases storage space in the 'loft'.
"Behind the woodshed" has a similar meaning.
The woodshed treatment is an expression for rather severe physical punishment, originating from the practice of rural fathers taking a boy who did soemthing considered very naughty to the shed or the barn, where other family members neither see nor hear them, in order to administer a spanking in private, often bared and bent over a work bench or so. The expression has stuck, even in an urbanized context, as in BDSM or for painful hazing.
"Woodshedding" is a musical term (usually in Jazz) for working on just one short section of a piece, to perfect and memorize it.