Grace is a quality (a type of accident) that inheres in the soul, analogous to how the quality of redness inheres in a red apple.
St. Thomas Aquinas, Summa Theologica I-II q. 110 a. 1 ("Whether grace implies anything in the soul?") co.:
when a man is said to have the grace of God, there is signified something bestowed on man by God.
I-II q. 110 a. 2 ("Whether grace is a quality of the soul?") ad 1:
Grace, as a quality, is said to act upon the soul, not after the manner of an efficient cause, but after the manner of a formal cause, as whiteness makes a thing white, and justice, just.
because grace is above human nature, it cannot be a substance or a substantial form, but is an accidental form of the soul.
Being is divided into substance (that which exists in itself) and accident (that which exists in another). Accidents are divided into quantity, quality, relation, etc. See this diagram.
That grace is a quality infused and inherent in the soul is also evident from the Council of Trent, session 6:
CANON XI.—If any one saith, that men are justified, either by the sole imputation of the justice of Christ, or by the sole remission of sins, to the exclusion of the grace and the charity which is poured forth in their hearts by the Holy Ghost [Rom. 5:5], and is inherent in them; or even that the grace, whereby we are justified, is only the favor of God: let him be anathema.
[Cdl. Manning's transl. of:] Canon XI.—Si quis dixerit, homines justificari, vel sola imputatione justitiæ Christi, vel sola peccatorum remissione, exclusa gratia et caritate, quæ in cordibus eorum per Spiritum Sanctum diffundatur atque illis inhæreat; aut etiam gratiam, qua justificamur, esse tantum favorem Dei: anathema sit.
Trent argues against Luther, who did not believe a transformation of the soul by grace is necessary for justification.