“Gun it” comes from early aviation and auto mechanics, who coined the phrase as an instruction to get more speed by pulling out the full throttle.
This sudden injection of fuel caused a minor explosion in the combustion engine, which sounded like the firing of a gun.
Stops are on a pipe organ for control volume, so to pull out all the stops refers to accessing the organ’s maximum power.
When wanting full speed and power we say, “Gun it” or “Pull out all the stops”.