The truss rod is part of a guitar or other fretted, stringed-instruments that stabilizes the lengthwise forward curvature (also called relief), of the neck. Usually it is a steel bar or rod that runs inside the neck, beneath the fingerboard. Some are non-adjustable, but most modern truss rods have a nut at one or both ends that adjusts its tension. The first truss rod patent was applied for by Thaddeus McHugh, an employee of the Gibson company, in 1921, though the idea of a "truss rod" appears in patents as early as 1908. 
A guitar neck made of wood is prone to bending due to mainly two factors: 1.) atmospheric changes, and 2.) the pull created by changing to a different gauge of guitar strings. A truss rod keeps the neck straight by countering the pull of the strings and natural tendencies in the wood.
When the truss rod is loosened, the neck bends slightly in response to the tension of the strings. Similarly, when tightened the truss rod straightens the neck by resisting string tension.
Guitar technicians usually adjust a guitar neck to have a slight relief (forward bend) to achieve reasonably low action in high fretboard positions, while letting strings ring clearly in low positions. A lower action in the high fret positions also facilitates more accurate intonation with less compensation at the bridge.
Relief achieved through the truss rod combines with the height of the bridge to affect the playability of the instrument. The two should be adjusted in concert with each other. Too much relief can make a neck feel floppy, slow and lifeless—while too little can make the strings buzz on the frets. Relief is typically measured as the distance between the string and the 7th fret while holding down the first and last fret. The amount of relief many guitar manufacturers prefer for an electric guitar is about .007 inches at the 7th fret.
Truss rods are required for instruments with steel (high tension) strings. Without a truss rod, the guitar's wooden neck would gradually warp (i.e. bend) beyond repair due to applied high tension. Such devices are not normally needed on instruments with lower tension strings, such as the classical guitar, which uses nylon (previously catgut) strings.
Truss rods also allow builders to make instrument necks from less rigid materials, such as cheaper grade of wood, or man-made composites. Without a truss rod, many of these materials would be unable to properly handle string tension at normal neck dimensions. The neck can also be made thinner, which may improve playability. In fact, the 1923 patent touts the possibility of using cheaper materials as an advantage of the truss rod. Before truss rods, builders had to make the neck out of a very rigid wood, and achieve relief by laboriously planing the fingerboard.
The truss rod is not specifically for adjusting intonation or action (height of the strings above the fingerboard) though adjusting it can make an instrument more easily playable.
The truss rod can be adjusted to compensate for expansion or contraction in the neck wood due to changes in humidity or temperature, or to compensate for changes in the tension of the strings (the thicker the guitar string, the higher its tension when tuned to correct pitch).
Usually, the truss rod of a brand-new instrument is adjusted by the manufacturer before sale. Normally, turning the truss rod's adjustment bolt clockwise tightens it, counteracting the tension of the strings and straightening the neck or creating a backward bow. Turning the bolt counter-clockwise loosens it, allowing string tension to act on the neck and creating a forward bow (higher string action).
Some guitars (notably Rickenbackers) come with dual truss rods that are more stable and not affected by seasonal climate changes. These rods are regarded as being more difficult to adjust.
Modern designs also include adjustment from the side of the heel of a bolt-on neck. When looking from the body of the guitar to the head, counterclockwise adjustment decreases the truss rod tension (correct an underbow) and clockwise adjustment increases the truss rod tension (correct an overbow).
Installing a truss rod in a newly constructed guitar requires woodworking capabilities. Special tools are required including a router with a variety of bits and ability to work with metals. Completed truss rods can be purchased through suppliers or manufactured according to specifications given in literature.
A dual action (also known as two way or double expanding) truss rod is a more modern design and it is currently being used by some luthiers in lieu of the vintage single truss rod. The dual action rod is installed in a straight channel in the wood as opposed to the curved channel used by vintage rods. The two-way rod can warp the neck in either direction, either creating more relief or less.
A neck with a two way rod installed is often more stable and less influenced by climate changes, as well as being able to restraighten twisted necks, which can be a hefty repair for other guitars. However, some players believe the dual action truss system has an adverse effect on the tone of the instrument, due to the weight of the second rod and the additional wood removal required for installation (although not all two-way systems use a second rod.)
Simple guide on how and why to adjust the truss rod created by Guitarbitz Guitar Shop