If your bike has internal cable routing, a rattling noise emanating from inside your frame when going over bumps (or knocking when turning) is commonly caused by derailleur housing or hydraulic brake ...
If your e-bike motor makes a grinding noise, it can be a little unsettling. A soft hum or light whir from an electric bike ...