Even those huge external flashes require assistance as does the pro camera to focus in "total" darkness. This is accomplished doing 1 or 2 things.
Preflash, which allows the camera to visually focus on the target. The problem here is that generally the lower end cameras will not focus fast enough to account for photographer sway or subject sway. This is not a great method. Works if the camera and subject are perfectly still.
IR Assisted focusing, which emits IR light the camera uses to focus on. Still, though, movement of the camera and/or subject can still throw this off. Most times, even the off camera flash units (I have a few Canon Speedlite 580 IIs) have IR assist and help the camera focus by adding even more IR light.
The biggest thing here is the whole "OMG TOTAL DARKNESS!" Consumer cameras are not meant to perform well in total darkness, much less smartphone cameras. Expectations, expectations, expectations.