Meaning
Flat-out is an idiom which can be used in several contexts as already written by @newb. In the context of the original question it means to go at a maximum speed. Merriam-Webster offers several definitions online (listed under "flat out" and "flat-out") including:
- informal (chiefly US): Absolute and complete.
- Greatest possible. Maximum.
Origins
@ws2 indicated flat-out may have originated with automobiles and specifically references having your foot flat on the accelerator pedal, similar to the phrase “Put the pedal to the metal.”
@oldcat indicated the origins may derive from horse racing where a rider or jockey must lie as flat as possible during a race to decrease wind resistance.
Intuitively both of these ideas seem plausible. However, if any origin is officially recognized, I haven’t found a reference to it yet.
(Rewritten based on comments.)