How is division calculated at the compiler / chip level?
And why does C ++ always throw these exceptions at runtime instead of compilation time (in the case where the divisor is known as zero at compile time)?
It is entirely up to the compiler. You can if you want to write an extension for your compiler to check this problem.
For example, visual C ++:
Large search tables. Remember these multiplication tables from school? Same idea, but division instead of multiplication. Obviously, not every number is there, but the number is broken into pieces, and then narrowed through the table.
Separation occurs at runtime, not at compile time. Yes, the compiler could see that the divisor is zero, but most people should not write an invalid statement like this.