> I don’t understand why Rust even has panics if its primary goal is safety.

Rust's goal is memory safety. Panics are perfectly memory safe.