Stiffness/compliance is one thing and vibration is another. Even mountain bikes with 6” of suspension travel can still transmit a lot of vibration through your hands on rough terrain. IME carbon bars reduce this vibration quite significantly. Carbon has good self-damping properties.
I’ve been riding 2 very similar endurance road bikes (Giant Defy and Canyon Endurace) for the last few years, both with modern carbon forks and same tires. My Giant had alloy bars and my Canyon has carbon bars and the latter transmits significantly less road buzz when riding on chip seal. It was the first thing I noticed when comparing these bikes and I had much thicker bar tape on my Giant. On smoother roads I don’t notice this so much.
When it comes to compliance over bumps then vertical stiffness comes into play. That’s where suspension and engineered compliance comes into play, regardless of material. But for higher frequency vibration, carbon has better damping properties than metals. The bars on both my Giant and Canyon had a degree of engineered vertical compliance, but the carbon bar had much less road buzz.