Diagnosis
That's coil whine from the internal transformer or power circuitry. It's not harmful, but it's irritating. It can be caused by a slightly off-spec voltage from your HVAC transformer or just a quirk of the unit.
How to Fix It
The most effective fix is to ensure the unit is getting clean power. Go to your furnace and check the low-voltage transformer connections. Ensure they're tight. If you're handy, you can try adding a 24VAC plug-in transformer to power the ecobee independently, but this is an advanced fix that changes your wiring setup.
If That Didn't Work
The sound might be coming from the relay inside the ecobee clicking. You can try disabling the audible 'click' sound. From the thermostat, go to Settings > Preferences > Sounds & Alerts > Button Press Sounds and set it to 'Off'. This won't stop electrical whine, but it eliminates the other common noise.
Heads Up
If the buzzing is loud or new, it could indicate a failing transformer at your furnace, which could eventually stop providing power. If the sound seems to be coming from the wall/wiring, have an HVAC tech check the system's transformer.