The basic mechanism is understood, though it is easier to experiment with organ pipes than a flute, because the geometry of the pipe doesn't change.
The air inside the pipe can resonate at any of the harmonic frequencies (though the amount of damping increases for the higher frequencies, because the diameter-to-wavelength of the vibrating air column increase, so it is harder to excite the higher harmonics).
The energy to excite the vibrations comes from the air travelling transversely across the embouchure hole, not by blowing "into" the hole. This air stream is disturbed by the oscillating air velocity in and out of the hole.
To excite a resonance, the time for the blown air to travel across the embouchure hole has to be in the correct relationship to the time for one oscillation of the air inside the pipe. For the flute, this is controlled by the player altering the direction of the blown air stream (because of the air viscosity, the velocity is higher in the center of the stream than at the edges, as it spreads out after leaving the player's lips) and the overall velocity of the stream (e.g. by narrowing the gap between the lips and/or increasing the blowing pressure).
It is possible to make an organ pipe such that slowly increasing the blowing air pressure will successively sound as many as six different harmonics of the pipe. For mouth-blown instruments, the practical limit is usually about three.
On the flute, the choice of fingerings can make it easier the air to vibrate in one particular harmonic, by opening a finger-hole at the place where an internal node should be in the vibrating air pattern. The same technique is also used in some so-called "harmonic" organ pipes, which are made double the normal length and forced to sound their second harmonic by boring a small hole in the pipe approximately at the mid point along the length.