The better educated can build on this brief response, but the artillery horses had to tough it out and take the same chances as the gunners. On the chances that guns needed to be repositioned or withdrawn they needed to be readily available, at least close enough to be called up at the command.
A graphic example of this can be found in Robert K. Krick's Conquering The Valley, in describing the struggle at the Federals' critical artillery position at The Coaling during the Battle of Port Republic. In the vortex of violence focused on and surrounding the guns, none less than Major Roberdeau Wheat, commanding the infamous Louisiana Tigers, emptied his pistol in to the horses, then went about cutting their throats with his knife, an onlooker describing him as "bloody as a butcher". Krick goes on to state that the colonel of the 66th Ohio ordered his men to shoot the horses as they were interfering with the defense of the guns, and that an Indiana soldier heard that two of the batteries lost a total of 68 horses killed.
There is a moving monument at the Virginia Historical Society honoring the 1.5 million horses and mules that died during the war, image attached.