Essentially this: if the marriage is invalid for any obvious reason (and you list a couple big ones), then there's no marriage and never was. Clearly, if the girl you married actually turns out to be your long lost twin sister, then the marriage is considered null because no valid marriage ever took place.
Catholic marriage is a sacramental arrangement. It's not a contract in the usual sense of the word, but a life long covenant and as a sacrament, the couple are imbued with God's grace. Of course, it's up to them to accept that grace and make good use of it!
Note that the marriage license you obtain from your local government office is meaningless to the Catholic concept of marriage. The only reason the priest signs that is so that he can comply with civil laws and it has no bearing on the nature of marriage itself. A woman and a man can quite validly go into a church and marry each other. (This kind of marriage is actually recognised by civil law in the US. I suspect it would amount to a common law marriage.)
Annulment is almost the only time that the average Catholic will ever come into contact with canon lawyers or the Church's legal system. Every diocese (like a state or county) has a marriage tribunal. Their basic function is to dig deep and find out if the marriage is actually valid or not.
And the tribunal is designed to determine if there were any impediments to the validity of the sacrament. Things like immaturity (inability to comprehend the nature of the union), gross misrepresentation of intention (she says she wants loads of children but had a hysterectomy that she's never talked about), abuse (physical, verbal, sexual, etc) are all reasons to strongly suspect that the marriage is not valid.
- Office of the Tribunal (Arlington Diocese)
- Myths About Annulment
Declaration of Nullity (don't bother reading the hateful article it was originally attached to, nor the misinformed comments).