In a monarchical state a subject is "one that is placed under authority or control" (Merriam). If A is subject to B, A is figuratively beneath B. This meaning makes sense with the word's roots of under and throw (again, Merriam; quotation below*).
In grammar, though, the subject, as we all know, acts. (Yes, the grammar structure can be passive so that semantically the subject is not active; even still the subject performs the verb, which in a passive structure, is to receive the action.) It has agency. It is the noun (or noun phrase) doing the throwing under and doing the subjecting, not being thrown under or being subjected.
How did subject develop such seemingly opposed meanings? It can certainly make reading lit theory confusing.
*Middle English suget, subget, from Anglo-French, from Latin subjectus one under authority & subjectum subject of a proposition, from masculine & neuter respectively of subjectus, past participle of subicere to subject, literally, to throw under, from sub- + jacere to throw