A camshaft is a shaft in your engine with one or more egg-shaped cams attached to it. As the camshaft spins, these cams or lobes, open and close the intake & exhaust valves, in time with the motion of the piston. This is a critical job, and can have a great impact on an engine's performance at different speeds.
If the camshafts are worn or not spinning correctly, it can cause your engine to run poorly. So, if your engine is idling roughly or accelerating poorly, ask your service advisor to take a look at your camshaft.
When a camshaft has a problem, it is usually a symptom of a much larger, more serious engine issue. The camshaft's link to the timing belt or chain, and the crankshaft, replacement or repair is usually not simple. If your camshaft stops spinning due to a broken timing belt, the piston could hit the open valves.
From a safety standpoint, there is a slight safety risk, because a failing camshaft may cause you to stall in unwanted situations. However, from an environmental point of view, there is low impact from a worn out camshaft.