The camshaft helps to open or close the engine intake or the exhaust valves at the exact time. The camshaft gets power from the crankshaft with the help of the timing belt or chain.
Because of the speed reduction in the timing mechanism, the camshaft rotates at half of the speed of the crankshaft.
The cams of the camshaft actuate the rocker arms which are connected further to the inlet and exhaust valves.
The engine can have one or two camshafts. The single camshaft has to handle both inlets as well as exhaust valves while in the case of the engines with two camshafts, the inlet valves and the exhaust valves are operated by separate camshafts.