The action taken by the autopilot to maintain an altitude depends on how far the aircraft is from the required altitude (altitude deviation).   Pitch attitude and present altitude deviation are required.