Ok so I have read more of the Foundation Trilogy and I have to say that the bit where the galactic empire invaded the Foundation and buggared off again doesn't seem so bad.
The second half of "The Empire and Foundation" and the first half of "The Second Foundation", are quite appealing.
I won't say they are completely free of deus ex machina or that they are literary masterpieces, but I have been enchanted by the concepts in them.
Firstly, the concept of psychologists/sociologists being good administrators. That is just excellent.
I love that idea, and wish it were used in real life. Imagine if our world was run by psychologists and sociologists, there would be no wars; any disagreements could be resolved by an hour on the couch talking about one's childhood.
Indeed, the Second Foundation which is run by psychologists and sociologists is quite a happy empire. The leadership knows exactly how to keep a population happy, even if they are dirt poor and living in hovels.
Furthermore, expansion of the empire is easy since all it takes is a few words to manipulate world leaders into joining the empire.
I think Asimov may have pushed the boundaries of plausibility with the emotional manipulation that does not require words, but I'll let that slide, it is science fiction after all.