charcoal cannister

What is the purpose of the charged canister that's bolted to the front wall of the engine compartment? Does it ever need replacement? just curious