It's far far more likely your shocking it.
The static charge is in your body 😉
USB isn't capable of delivering enough energy to shock you, and i very much doubt apple chose to use some sort of large capacitor just to make you jump 🙂
The only reason you shocking this keyboard, and not your old one, is the new one is metal and, of course, grounded.