A jet engine, like a rocket engine, is a reaction engine. It works by throwing mass in one direction and taking advantage of the reaction in the opposite direction. In the case of a jet engine, the engine burns fuel (like kerosene) with air from the atmosphere. The burning fuel heats and expands the air, and this hot air shoots out of the exhaust-end of the engine to create thrust.
Most modern jet engines use a turbine to improve the efficiency of the engine and allow the engine to work at low speeds. One part of the turbine sucks in air and compresses it before the fuel is injected. The back portion of the turbine acts like a windmill, extracting energy from the exhaust gases and using the energy to spin the compressor portion. See How Jet Engines Work for details.
A modern turbine engine is extremely efficient, and there is still a lot of oxygen available in the exhaust stream. The idea behind an afterburner is to inject fuel directly into the exhaust stream and burn it using this remaining oxygen. This heats and expands the exhaust gases further, and can increase the thrust of a jet engine by 50% or more.
The big advantage of an afterburner is that you can significantly increase the thrust of the engine without adding much weight or complexity to the engine. An afterburner is nothing but a set of fuel injectors, a tube and flame holder that the fuel burns in, and an adjustable nozzle. A jet engine with an afterburner needs an adjustable nozzle so that it can work both with the afterburners on and off.
The disadvantage of an afterburner is that it uses a lot of fuel for the power it generates. Therefore most planes use afterburners sparingly. For example, a military jet would use its afterburners when taking off from the short runway on an aircraft carrier, or during a high-speed maneuver in a dogfight.
The following pictures, taken at the Virginia Air and Space Museum, show you some of the details of an afterburner-equipped engine. This particular engine comes from an F-4. Here is the main part of the engine:
This includes the compressor, combustion chamber and exhaust turbine. At the exhaust end of the engine, you can see a ring of injectors for the afterburner, as shown here:
Here's a close-up of one of the injectors:
Attached to the end of the engine would be a tube and adjustable nozzle, as shown here:
This tube is about 8 feet long (2.7 meters). The engine itself is about 12 feet long (4 meters).
Here are several interesting links: