The A80 reads the CCD and looks for sharp contrast on between pixels. If it can't find any, it gives up, warns the user (orange square instead of green) and the camera will then take a photo anyway. Also, just because the conputer attained what it thought was a great contrast, does not mean it actually captured good focus. (This is not a Canon thing, but prevailant with this type of focusing system.)
The reason for this focus system is used is that it's cheap (no extra hardware) and it overcomes the Infra Red problem of inability to focus past a certain distance (I think it's like 15 feet)
If you want great focus all the time, get a camera that employs both passive focus (off the CCD) and Infra Red focus (for low light situations) But these cameras will be bulkier, and costlier...
If the camera can't lock focus, go to manual. If using flash, set the F stop to 5.6 to 8, and set the distance to where you most likely will be shooting, then most of your shot will be focused. (And you'll cut down on time waiting for the camera to try and find focus...)