Energy minimisation used to optimise geometry

How does the program know when it has arrived?

Both of these tests have to be satisfied in the program Gaussian

What can go wrong?