The camshaft is usually a set of cams which, due to their shape and rotational movement, open both the intake and exhaust valves. There may be one or two camshafts in the head. Through the construction of the cam, the manufacturer determined how much fuel would go into the cylinder (I ignore the efficiency of the injectors). By installing a sharp camshaft, we increase the opening width of the valves, improve the speed between opening and closing, and extend their opening time. All of this is to increase power.