In ST Ia q1 a10 St Thomas says some interesting things about the different senses of Scripture, and especially about its literal sense.
The author of Holy Writ is God, in whose power it is to signify His meaning, not by words only (as man also can do), but also by things themselves. So, whereas in every other science things are signified by words, this science has the property, that the things signified by the words have themselves also a signification. Therefore that first signification whereby words signify things belongs to the first sense, the historical or literal. That signification whereby things signified by words have themselves also a signification is called the spiritual sense, which is based on the literal, and presupposes it. Now this spiritual sense has a threefold division. For as the Apostle says (Hebrews 10:1) the Old Law is a figure of the New Law, and Dionysius says (Coel. Hier. i) “the New Law itself is a figure of future glory.” Again, in the New Law, whatever our Head has done is a type of what we ought to do. Therefore, so far as the things of the Old Law signify the things of the New Law, there is the allegorical sense; so far as the things done in Christ, or so far as the things which signify Christ, are types of what we ought to do, there is the moral sense. But so far as they signify what relates to eternal glory, there is the anagogical sense. Since the literal sense is that which the author intends, and since the author of Holy Writ is God, Who by one act comprehends all things by His intellect, it is not unfitting, as Augustine says (Confess. xii), if, even according to the literal sense, one word in Holy Writ should have several senses. [emphasis added]
It’s not usual for us to think of communication as having more than one literal meaning, but it’s not unheard of. That’s the whole point behind double entendres, for example. So what Aquinas says here isn’t unreasonable even with respect to human communication.
One interesting aspect to what he says, though, is that he omits any consideration of the human writers of the Bible. God is the Author of the Bible, full stop, at least when it comes to the question of understanding what is written there. This isn’t a mere historical oddity; it’s what the Church still teaches (“God is the author of Sacred Scripture,” CCC §105). So for Aquinas, when we ask the question “what does the author mean by this passage of the Bible?” it seems (from what he writes here in ST) that he always means to ask “what does God mean by this passage of the Bible?” rather than “what does St Matthew mean?” or “what does Isaiah mean?” Now I suppose it’s not unreasonable to think that at least sometimes (or even usually) what the human writer means and what God means are likely to be the same, but it should go without saying that there can’t be any strict identification of the two. God may mean things that never even occur to the human writer. In short, interpretation of the Bible as God’s Word necessarily demands more than merely understanding the text as a purely human artifact.
[Update, 31 March 2016]
I am sure that St. Augustine has more to say on this subject elsewhere in his works, but I came across this while reading City of God and thought it a suitable supplement to this post insofar as it demonstrates that Aquinas’ approach was neither novel nor unique to him.
[T]he Hebrew people was gathered and united in a kind of community designed to perform this sacred function of revelation. In that people the future course of events, from the coming of Christ to the present day, and even beyond, was prophesied through the agency of some who realized, and some who did not realize, what they were doing. (VII.32; emphasis added)
With respect to hermeneutics what Saint Augustine is asserting is that there is at times in the Bible a distinction between what the human authors intended by what they wrote and what God intended by what they wrote. The two cannot be strictly identified, just as I wrote above.