The game seems to assume ideal battlefield conditions with perfect intelligence. However, sometimes battlefield conditions aren't ideal and intelligence isn't perfect.
The special attack charge says
You must move before your attack, not after. You must move at least 10 feet (2 squares) and may move up to double your speed directly toward the designated opponent. ...
You must have a clear path toward the opponent, and nothing can hinder your movement (such as difficult terrain or obstacles). You must move to the closest space from which you can attack the opponent. If this space is occupied or otherwise blocked, you can't charge. If any line from your starting space to the ending space passes through a square that blocks movement, slows movement, or contains a creature (even an ally), you can't charge. Helpless creatures don't stop a charge.
If you don't have line of sight to the opponent at the start of your turn, you can't charge that opponent. ...
Emphasis mine. There's more to it than that, but I think those are the important parts.
- The path between the creature and the foe contains 1 square of difficult terrain. The creature has the special ability—that the creature has not used—to take a free or swift action to ignore 1 square of difficult terrain.1 Without using that special ability, can the creature designate the foe as the target of the charge?
- The path between the creature and the foe contains 1 square of difficult terrain of which, because of magic or camouflage, the creature is unaware.2 Can the creature designate the foe as the target of the charge?
- The creature's ally has taken the ready action to make an attack with the trigger If the creature gets within 5 ft. of the first foe. On the creature's turn, the path between the creature and second foe is blocked by the first foe. Hoping his ally's attack will render the first foe helpless, can the creature designate the second foe as the target of the charge?
- The path between the creature and the first foe is blocked by a second foe that the creature can't perceive due to magic or camouflage. Can the creature designate the first foe as the target of the charge?
1 For example, the travel domain's supernatural ability agile feet.
2 Further, any creature wearing rubble gloves (8,000 gp; 1 lb.) could ready an action to activate the gloves with the trigger When I'm within a charging creature's apparent reach, therefore activating the gloves before the creature (apparently) threatened the wearer of the gloves.