By 'matter' St Thomas does not mean material substances (corpora), but a sort of matrix, or mother-stuff, conceived as not yet determined by any active principle, or 'form,' and therefore in potentiality to all manner of material forms. This is called by the schoolmen materia prima, or primordial matter. Primordial (or formless) matter, as such, nowhere exists: that is to say, all existing matter is determined by some particular form, so as to make this or that material substance or body: but primordial matter underlies all material substances. For a first notion (I do not mean St Thomas's notion) of primordial matter, see Plato, Timaeus, 50, 51, 52.
Of God and His Creatures: 2.16