THe fan is normally controlled by a relay that is in turn controlled by the Thermostat. I will however tell you of a problem I had not T-Stat related.
The Compressor may turn off due to freeing up of the condenser or due to "I'm cold enough" signal from the T-Stat..
ANd both of them the motor can overheat and shut down.
The problem I had.. Brand new motor home 13 years ago..
Both AC and Compressor would stop or start together (normal the compressor had a slight delay for reasons already mentioned) sometimes one would work, sometimes the other, both or neither.
Turns out I have a few screws loose (Don't say it) like the ones in the electrical distribution (Breaker box) panel which clamp the wires.. one took 3 1/2 turns before I was happy. Many were loose