In general, how does a DFA know how to successfully process a string the intended way?
The transition function of a DFA has the type $\delta : (Q \times \Sigma) \rightarrow Q$. That is, it's a function that takes a state (from the set of states) and a symbol (from the set of symbols) and returns another state.
This function doesn't have to know anything about tokenization. It's given a single symbol, and that's all it cares about.
Similarly, the input to a DFA is generally defined to be an ordered series of symbols: this is what &quot;a string over the alphabet $\Sigma$&quot; means mathematically. If it helps, think of it as a &quot;list&quot; rather than a &quot;string&quot; in programming terms. So if the alphabet were $\{x, xx, xxx\}$, then the input might look something like $[x, xx, xxx, x, xx, xxx, x, xx, xxx]$. No ambiguity there.
In practice, most real-world DFA implementations (like foma) do have to care about tokenizing. But the details of how to do that are up to the implementation; the definition of a DFA doesn't care one way or the other.