Being Flat-Footed is a creature state used for combat, specifically when determining armour class, for:

The term is from D&D and is for when a creature is unable to defend themselves by moving or are unaware of combat - eg; they cannot dodge a sword if they're paralyzed in place.

When are you Flat Footed

Or rather when are you not flat footed? Being flat footed is in fact a default game state - when you are simply standing there, if attacked, well, you're considered flat footed.

These states cause a creature to be flat footed:

The action you are taking can also affect it, you're flat footed when not doing combat actions, ie:

Feats Affecting Flat Footed

The usually creature-only feat "Uncanny Reflex" will mean the creature can never be flat footed unless Stunned, Paralyzed, Entangled, Petrified, or Sleeping. So even if not doing a combat action they'll be fine and have all their usual AC.

The uncanny dodge and defensive awareness feats allow retention of the dexterity AC bonus when flat-footed, but dodge and tumble bonuses are still lost (as is the ability to make attacks of opportunity, etc.).

Effects of being Flat Footed

A creature that is flat footed will lose access to your Dexterity Bonus, Dodge AC bonus, Tumble AC bonus (although if you have negative Dodge AC, it apparently also ignores that!).

The creature also will have Sneak Attacks, Death Attacks automatically apply (if the usual requirements are met).

The feats Defensive Roll and Deflect Arrows cannot apply if you're flat footed.

You cannot make Attacks of Opportunity when flat footed.

Pseudocode of Flat Footed

This is how the engine determines flat footed conditions:

int GetFlatFooted()
    if (GetCreatureStunned()) // EffectStunned
       return TRUE;
    if (CannotUseLegsOrArms && Mode != DefStance) // Paralysis, Entangle, Sleep, Petrified, etc.
        return TRUE;

    if (GetHasMonsterUncannyReflex()) // FEAT_UNCANNY_REFLEX
        return FALSE;
    if (GetIsBlind()) // The person is blind, or blind enough
        return TRUE;    

    if (IsDoingTask())// most actions, eg, picking up items, opening stuff, resting etc and also standing around doing nothing. This also checks for Knockdown (Prone) animations.
         return TRUE;

    // Moving, or actively doing combat-related things
    return FALSE;