When you introduce input from users, they won’t always provide input that is going to work for your program. When that happens, you need a way to have the program recognize that something is wrong and address it, without completely crashing.
When a program encounters an error, it “throws” it. You can then “catch” the error and do something with it, usually to provide some feedback for the user to know what they did wrong.