Why is “In fact” not a prepositional phrase?

Prepositional phrases have a core structure:

They must have a preposition followed by a noun or pronoun that acts as the object of the preposition. This creates a unit that modifies another part of the sentence.

Examples:  

on the table
with a smile
under the bridge  

“In fact” doesn’t follow this:

“Fact” is not the object of the preposition “in” in this case.

Instead, “in fact” functions as a single unit with an adverbial meaning. It’s similar to these adverbs:  

actually
truly
indeed

How it acts in a sentence: “In fact” modifies the whole sentence or the verb, adding emphasis.

It doesn’t describe a relationship between a noun and another part of the sentence like a prepositional phrase does.

In “in fact,” the word “in” has lost its usual prepositional role and become part of a fixed adverbial expression.  

Example: “In fact, the evidence supports a different conclusion.” (Here, it emphasizes the truth of the evidence)

Think of it like this: Some words that look like prepositions can function as different parts of speech depending on their context.