The AI checks the military overview and notes the pointy-sticks score. This is calculated from the number of units and the tech level of those units. There's been some talk in theses forums the AI uses the military adviser as well to decide whether to DOW or not.
Info Addict: the AI doesn't have access to this even if you do but the military score is calculated from number of units, tech level, and health of your units.
Chances of DOW: The major factor seems to be pointy-sticks score, but I've noted overall score seems to factor as well assuming you haven't done anything major to warrant a DOW.