Why does car shake when applying brakes even though front and rear brakes rotors and drums were replaced shakes when pulling emergency brake as well bearings and tires are good?

Good question. You may have an antilock brake circuit that is not sensing the brakes correctly and improperly correcting. Anti lock pulses the brakes when you apply them. I don't know if this is perfected or not.