how is shadowboxing and bag work any different? At least with bag work you're actually hitting something.
Shadowboxing is much more important because you're imitating an actual fight in your head, you're working the angles and footwork.
The heavy bag is stationary, it's for training power. You unload your power shots on the heavy bag and that's it. But in a proper fight the opponent will not be a stationary target like the heavy bag or if he is that means that he's a good and experienced brawler and maybe it's not a good idea for you to be stationary in front of him so you better learn how to move around a bit.
When you're shadowboxing you practice throwing punches while moving around at the same time and you can also practice upper body movement, imagining that you have to dodge your opponent's punches, switching between offense and defense etc. There's basically not a single thing that you can't do while shadowboxing.
If you look in history there were boxers who hardly sparred, boxers who didn't like mitts (Ali) or didn't like heavy bag but you won't find a single relevant boxer who didn't shadow box. Shadowboxing is like your signature as a fighter, it's the base for everything.
Heavy bag is important too because you train power on it and you prepare your hands.
IMO Hopkins explained perfectly here why you need to work the heavy bag:
Another thing that I'd like to point out is that boxing training is not only difficult physically but mentally too because you have to be so concentrated on what you're doing all the time so it's a good thing to do say 5, 6 rounds straight on the heavy bag every now and then to let your mind go and just punch a bit. You're still doing something physically and training your muscle memory for boxing while resting your mind a bit.