A camshaft is a critical component in an internal combustion engine. It controls the opening and closing of the intake and exhaust valves by converting rotational motion from the crankshaft into linear motion to operate the valves. The timing and duration of valve opening are crucial for engine performance, fuel efficiency, and emissions.