Battle honors, for both sides, usually came from orders from army or corps commanders. Sometimes division commanders but mostly from officers higher up.
If you have the CD-rom version of the ORs, type in "battle honors" and see how many citations pop up that you can read about.
Battle honors were almost always added to flags that replaced those used in the battle where that honor was earned. Thus, they help us date when the flags were issued usually.
Union honors were painted on by the flag makers and CS flags from the Richmond Depot were done in a similar way. They outsourced that to local painter Lewis Montague. The only ANV divisions that had honors were those of DH Hill (later Robert Rodes'), AP Hill (later Dorsey Pender's and part of Henry Heth's) and Ed Johnson's. There were brigade level issues of flags with battle honors including Kershaw's SC Brigade, Lane's NC Brigade, Cox's NC Brigade, Lang's FL Brigade, etc. Many, if not most, ANV flags were unmarked by honors.
For the CS troops out west, the honors were done on a divisional issue it seems based on orders from the AOT commander. The first authorized honors were for Shiloh and then came Perryville. Unique to the West only, were the cross-cannons inverted battle honors given to CS regiments that had captured Union artillery in battle.
For more on these see our Flags of the Confederacy website at www.confederateflags.org