What is an out-of-trim condition and how is it detected?
The trim system on an aircraft relieves the control pressures so that the aircraft maintains an attitude without pressure on the control system.

When hand-flying this is very noticeable in that you constantly have to be pushing, pulling, or turning (in the event you have aileron trim) to maintain an attitude. Notice how I don't say "straight and level", you can trim an aircraft to maintain a climb/descent or other attitude as long as the trim tabs have enough authority.

Autopilots detect an out-of-trim condition the same way you do. They sense that there is pressure on the controls to maintain the desired attitude, and if this is over some threshold it will display a warning light for an out-of-trim condition. Some autopilots have a trim-up or trim-down light to help the pilot determine which way to trim the aircraft.

Here is a diagram from a S-Tec System 50 Autopilot found in many GA aircraft:


The "out of trim" condition lights are two yellow indicators on the right side of the auto-pilot instrument.

Why is this important? Mostly for the longevity of the equipment. The autopilot works by either physically moving the cables or actuating the hydraulic system. It uses power to run motors which cause the motors to heat up and use electrical power. By trimming the aircraft, you can reduce these forces required by the autopilot so that it isn't working so hard to control the aircraft.

Another good reason is that you don't want the aircraft to do something unexpected when you hit the autopilot "off" or "disconnect" switches. This is especially dangerous in IMC when you don't have a visual reference to anything. There are also conditions which can cause the autopilot to disconnect automatically, and it takes a few precious seconds to figure out what is going on before the pilot gets positive control.