Adding "the" reverses the meaning in these two sentences:
Alice is in charge of Bob.
Alice is in the charge of Bob.
What is the formal grammatical explanation of this difference?
In charge of is a complex preposition like in place of, in spite of, in view of, or in case of. It means having responsibility for or jurisdiction over someone or something. In the charge of is a preposition phrase meaning in the care or custody of someone.
A similar change in meaning occurs when the definite article is inserted into the complex preposition in view of. In view of means because of and in the view of means in the opinion of.
And She was sitting in front of the car (complex preposition) has a different meaning from She was sitting in the front of the car (preposition phrase).
ADDENDUM:
The Cambridge Grammar of the English Language (p616) contests the traditional designation of complex prepositions for phrases such as in charge of, by dint of. It refers to them instead as idiomatic and fossilised expressions headed by a preposition.
The CGEL then uses various syntactic tests to compare such idiomatic expressions to prepositional phrases that permit what it calls free expression. So, for example, the [bracketed] free expression She put it [on the photo of her son] permits the full range of syntactic manipulations, including:
She has lost [the photo of her son]. (occurrence without preposition)
She put in [on her son's photo]. (genitive alternation).
The most fossilized expressions permit none of the nine syntactic manipulations allowed of free expressions. The CGEL lists in case of, by dint of, by means of among the completely fossilized expressions.
In charge of is an example of a less fossilized phrase that permits some manipulation, but not all. For example, it permits modification of the noun (eg. in full charge of), but not omission of the head preposition (*She was put charge of the orphans).
As a free expression, in the charge of permits all the syntactic manipulations. The CGEL notes elsewhere that the preposition of in a free expression such as They were mourning the death of their king has no identifiable meaning independent of the grammatical structure in which it occurs. Such grammaticised uses ... serve the same function as inflection cases. Hence, the death of the king is equivalent to the king's death.
So, as Op notes in the comment below, in the charge of Bob is equivalent to in Bob's charge, and similar to in Bob's care, in Bob's power, in Bob's custody. The reason why the definite article is used in the free expression in the charge of is the same reason it is used in any such genitive construction.
And the reason that in the charge of Bob reverses the meaning of in charge of Bob is that the semi-fossilized idiomatic expression in charge of means responsible for or having jurisdiction over (an active role), whereas the noun charge in the free expression in the charge of means care or custody, and is equivalent to being the responsibility of (a passive role).