I originally wrote this as an answer to a question on Quora.
It forces you to figure out how to solve a problem in a way that can be explained to a computer.
By doing this you learn to break down a problem into its components, how to define the problem using constraints (you have to figure out what’s going to go in and what’s going to come out of your code), you have to be precise, and you have to have a full understanding of all of the components of the problem and its solution in order to solve the problem.
This define and disassemble approach to problem solving is something that is very applicable to problems across many domains, especially science, engineering, and mathematics.