In times past, camshaft and valve timing were synchronized based on the exact position of the camshaft gear when the timing chain or belt of an engine was installed. Valve overlap -- the brief period when both intake and exhaust valves are open in any given cylinder -- was controlled only by the design of the camshaft. There was no way to adjust it without modifying the camshaft itself. Traditionally, this was called fixed-valve timing, not to be confused with valve lash, which is the clearance between the rocker arm and push rod on push-rod style engines. This is where variable valve timing comes in.
The Role of the Solenoids
A camshaft actuator solenoid --normally installed in the front of each cylinder head -- is used to precisely control the flow of oil into the camshaft actuator. This changes the rotation of the camshaft to adjust valve timing and valve overlap on the go. These solenoids are used to control both exhaust and intake camshafts, creating the possibility of lower emissions -- and essentially decommissioning exhaust gas recirculation valves -- as well as better performance and fuel economy. In typical designs, the solenoids are in their parked position when the engine is off and immediately after it has started. Once oil pressure builds, the powertrain control module adjusts camshaft timing via the actuator solenoid depending on things like engine speed, throttle position, manifold pressure, engine load, barometric pressure and the position of the crankshaft.
A trouble code related to either camshaft actuator solenoid doesn't necessarily mean the solenoid has failed. If you don't change your oil on a regular basis, gunk buildup will form and block oil flow into the actuator. The PCM notices the camshaft didn't adjust as it was intended to and sets a trouble code related to the actuator solenoid.