How does it work or works?
Your first example, how it works, is a free relative clause which cannot be used as a question. Your second, How does it work?, is an ordinary question.
What I’m going to call an “interrogative phrase” (IP) is a sort of ‘variable’ which stands for an unknown ‘value’. The IP is headed by a word which defines the ‘type’ of value for which it stands: who, what, which define the type as nominal, how, where, why define the type as adverbial, and the construction what ... do defines the type as a verbal. The IP may also be followed by additional terms which further restrict the type—how many or what sort of machine.
Two sorts of clause employ IPs: questions and free relative clauses. In both sorts of clause the IP represents a constituent of an ordinary declarative clause, ‘moved’ to the beginning of the clause from the place where the constituent would normally stand:
But the two sorts of clause play very different roles, and have different syntactic structures:
- A question asks the hearer to supply the value for the variable named by the IP and defined by the remainder of the clause. A question is an independent clause—it can stand on its own.
The first syntactic rule is that first constituent1 after the IP must be a tensed verb. If the IP stands for the Subject of the clause, nothing has to move, because the IP and the verb are already in these positions:
But if the IP stands for some other constituent, the tensed verb must fall before the Subject, and a second rule comes into play: the tensed verb must be an Auxiliary. (Grammarians call this subject-auxiliary inversion.) If the ‘canonical’ statement version of the clause does not have an Auxiliary verb, the appropriate form of DO is pressed into service. (Grammarians call this DO-support.)
Thus the proper form for a question using how is this, with both subject-auxiliary inversion and DO-support: 1Note that an adjunct—a non-essential syntactic component—is allowed to fall between the IP and the tensed verb: Who recently wrote an app?
A free relative clause does not ask for the value of the IP but designates it—hearers may fill it in from their own knowledge, but an actual value is not required.
A free relative clause does not call for either inversion or DO-support, regardless of which constituent the IP stands for. After the IP at the beginning, the ‘natural’ order of a declarative sentence is maintained, Subject-Verb-Objects/Complements; the only thing that signals that this is not an ordinary declarative sentence is that something is missing where a constituent was ‘replaced’ by the IP and ‘moved’ to the front.
A free relative clause is always a dependent clause—it is embedded inside a ‘head’ clause and acts as a noun phrase. In these three examples, the head clause is in ordinary black type; the free relative acts as Direct Object, as Subject, and as the Object of the preposition about.
(Since DO-support is not in play here the tensed verbs are not distinguished.) How it works, then, with the subject before the verb, is a free relative clause. Here are some examples of how it might be used: