Panasonic's engineers realized that they had more information to work with than just whether incremental changes in focus resulted in better or worse contrast measurements; they could also tell how much the contrast signal improved or worsened. By knowing how much the focus improved or worsened after a small focus change, they had an opportunity to tell how far out of focus the lens was. They had the opportunity to tell that, but actually knowing how far the lens needed to travel required that the camera know a great deal about the lens. Basically, the camera has to have a detailed understanding of the lens' bokeh, across the full range of out of focus conditions, at all focal lengths (in the case of a zoom lens), and all apertures.
That's a pretty tall order, but since Panasonic manufactures their own lenses, they could in fact characterize each of them fully in this regard. So of course, that's what they did, and they loaded a full database of the bokeh behavior of all their current lenses into the GH4's memory. As a result, no matter the focal length, aperture, or subject distance, the GH4 can very quickly determine now much out of focus each lens is, and in what direction, just by comparing two images, acquired in rapid succession, with a small lens movement in between. By interpreting the change in bokeh from one "look" to the next, the GH4 can calculate how far it needs to move the lens, to get very close to the final focus setting. After this rapid movement, it does one or two normal contrast-AF cycles to fine-tune the focus, before snapping the shot.