There is a difference between a legal annulment and a church annulment. Catholic annulment does NOT mean that the children from the marriage are illegitimate. It means that there was some spiritual impediment that prevented a true union from taking place. It has no bearing on the legitimacy of the children.
That could mean that one member of the couple was under age. It could mean that one member of the couple harbaored reservations about the marriage -- spoken, or unspoken. it could mean that one member of the couple did not intend to enter into a Catholic marriage, i.e. that one member of the couple did not intend to welcome children into the union. It could mean that one member of the couple all along thought that divorce was an option if things did not work out.
There are many other reasons that can be brought before the church tribunal in a petition for an annulment. Some of the requirements are statements from witnesses who know the couple before and after their marriage, as well as from the parents of both husband and the wife.