I understand that the Catholic Church issues annulments in place of divorces under certain circumstances. When did this practice first begin and under what was the reasoning given for it and its distinction from divorce?
Definition: An annulment doesn't dissolve a marriage; an annulment is a solemn pronouncement that there never was a marriage contract (as explained in the pronouncement) and, therefore, what was perceived as a marriage was in fact null.
Why: In order for a marriage to be valid, it cannot be null. If a marriage is ruled to be null then the couple can either try to fix the issues regarding the cause of nullity or must separate (which typically already happened).
When: Presumably this practice was with the Church from the beginning. The reason it was so rare previously is that Catholics used to be taught their Faith before seeking to get married, and as part of their marriage preparations they used to be "annulment proofed" both by the priest insuring the couple are mature, sane, morally capable and aware adults, as well as the custom of "reading the bands" which, among other things, was a moral requirement for anyone who knew of an impediment for the couple to get married (which would be grounds for nullifying the attempted wedding contract) to come forward and make it known to the priest. These days, with inadequate education in the Faith, general immaturity of the populace in general and people seeking to get married in particular, and no moral requirement to make impediments known to the clergy, it can only follow that the number of annulment cases will skyrocket.
The Catholic Church regards itself as bound by the words of Jesus, who is reported (Matthew 19:9) as saying:
I say to you, whoever divorces his wife (unless the marriage is unlawful) and marries another commits adultery."
On the face of it, this places the origin of Catholic annulment in the time of Jesus, limiting the purpose of annulment to instances in which the marriage is unlawful. However, Matthew's Gospel (Matthew 5:32) also provides a further ground for annulment, sexual immorality (πορνείας). This greatly widens the options for annulment, and the New Jerusalem Bible and the New American Bible prefer to translate πορνείας as 'unlawful', suggesting that the Catholic Church has not seen Matthew 5:32 as justifying annulment on the grounds of immorality.
In 1 Corinthians 7:10-13, Paul expresses disapproval of divorce, but says that if a wife does divorce her husband, she must remain single:
To the married, however, I give this instruction (not I, but the Lord): a wife should not separate from her husband - and if she does separate she must either remain single or become reconciled to her husband - and a husband should not divorce his wife.
Here Paul does not prescribe grounds for divorce or annulment, although later he says that irreconcilable incompatibility of beliefs could be grounds for a marriage breakdown. Paul wrote this in the context of an imminent parousia, necessitating all to remain the their present state if possible - see verse 20, "Everyone should remain in the state in which he was called."
An early historical reference to Catholic annulment involves Pope Nicholas I (858-867), who refused to grant an annulment to King Lothair II of Lotharingia so that Lothair could marry his mistress Waldrada, but a Council pronounced in favour of the annulment, resulting in Nicholas disbanding the Council. Regardless of the outcome for Lothair, it seems that Church annulments were an established fact, at least for the ruling classes.
When Louis XII became king of France in 1498, he had his marriage with Joan annulled by Pope Alexander VI so that he could marry Anne of Brittany.
Jesus's words at the time of marriage were pretty clear Mark 10 (KJV)
... Is it lawful for a man to put away his wife? tempting him. 3 And he answered and said unto them, What did Moses command you? 4 And they said, Moses suffered to write a bill of divorcement, and to put her away. 5 And Jesus answered and said unto them, For the hardness of your heart he wrote you this precept. 6 But from the beginning of the creation God made them male and female. 7 For this cause shall a man leave his father and mother, and cleave to his wife; 8 And they twain shall be one flesh: so then they are no more twain, but one flesh. 9 What therefore God hath joined together, let not man put asunder.
A later rendering of that is the familiar 2And the Pharisees came to him, and asked him, Is it lawful for a man to put away his wife? tempting him. 3And he answered and said unto them, What did Moses command you? 4And they said, Moses suffered to write a bill of divorcement, and to put her away. 5And Jesus answered and said unto them, For the hardness of your heart he wrote you this precept. 6But from the beginning of the creation God made them male and female. 7For this cause shall a man leave his father and mother, and cleave to his wife; 8And they twain shall be one flesh: so then they are no more twain, but one flesh. 9What therefore God hath joined together, let not man put asunder.
It doesnt say any thing about annulment. Annulment came from men, not Jesus. Who is the boss here on earth: man or Jesus?
Later traditions captured the essence of Jesus's point, for example a phrase first found 'The Book of Common Prayer' (an Anglican text published in 1549) "tyl dethe us departe", which translates to "till death US DEPART" and then was "till death US DO part" before it became "till death DO US part". Source: Daniel, Evan (1901) . London: Wells Gardner, Darton & Co., 491-494 – (credit to @kraftydevil for the source and note).