If you have heavy handing (FMA:B, Cobra, etc) then AQ of up to about 1.2-1.3 is necessary. Anything more than that and you want to look at dithering and 10bit encoding tbqh. The general way it works is as mirko said, where bits from flat areas are relocated to areas of higher detail. The strength is a scale of 0-3 on how aggressive that is. Note that you can use zones in x264 to apply different strengths to different sections, IIRC anyway. Once you get to high AQ strengths however, you tend to make flat areas blocky, and at lower strengths you'll have the opposite effect of detailed areas getting squandered for useless chroma gradients.