[Matrimony] is the sacrament between the baptized in which a man and a woman by lawful exchange give [tradunt] their own bodies for perpetual fellowship of life, of support of children, and for cure of worldly craving [remedium concupiscentiae]. The proximate and original [ex qua] matter is mutual consent expressed in external sign, insofar as it has the character of giving [traditionis]. And the form is the same consent, insofar as it has the character of receiving [acceptationis]....The minister is not the priest, but the very ones uniting, because they combine the matter and the form.
[St. Alphonsus Liguori, Theologia Moralis 6.2.1, my translation.]
Materia ex qua, from-which material, is a technical term for that which has the potential to become a new thing; to say that something is the materia ex qua et proxima is to say that it is specifically that which becomes a new thing.
There has, for much longer than I've been alive, been a reaction in academic theology against the use of the form and matter terminology in discussing sacraments; it's criticized as being too Aristotelian, too pedantic, etc. This is, unfortunately, all nonsense, and based on a completely incorrect notion of why it was used in the first place. The terminology is (very, very broadly) Aristotelian, but the point is not to be Aristotelian but to insist that the sacraments involve real change, and not a mere renaming. In a real change, there is something that in some sense stays the same, the material of the change; and there is something that is newly acquired, the form that makes it possible to say that there has been a transformation. That is all. In this case, the spouses make the sacrament by taking each other's expressed gift (the matter) and, by accepting it (the form), transforming that gift into something new.
Incidentally, although St. Alphonsus doesn't mention it, it is worth noting that "mutual consent expressed in external sign" is the general principle of the entire sacramental economy. As a sacrament, matrimony represents the union of Christ and His Church, which also occurs by mutual consent expressed in external signs, which signs are, of course, the sacraments themselves.