God gives grace which enlighten and raise the faculties of the author.
He does not dictate, but rather gives the power to the inspired author to convey Divine Revelation.
The Catholic Encyclopedia says:
“The Holy Ghost Himself, by His supernatural power, stirred up and impelled the Biblical writers to write, and assisted them while writing in such a manner that they conceived in their minds exactly, and determined to commit to writing faithfully, and render in exact language, with infallible truth, all that God commanded and nothing else; without that, God would not be the author of Scripture in its entirety” (Encycl. Provid. Deus, in Dena., 1952)."
“Seen in this light, the hagiographer no longer appears a passive and inert instrument, abased as it were, by an exterior impulsion; on the contrary, his faculties are elevated to the service of a superior power, which, although distinct, is none the less intimately present and interior. Without losing anything of his personal life, or of his liberty, or even of his spontaneity (since it may happen that he is not conscious of the power which leads him on), man becomes thus the interpreter of God. Such, then is the most comprehensive notion of Divine inspiration.”