Testing is the process to check the changes in code or data to make sure it meets the business requirements. It is the step before moving changes into the production environment. It is probably the most important step in the project life cycle. If you test properly you can detect problems with the code before they become catastrophic issues in production.
Test cases are written to test the changes in the code. A test case will cover the inputs, the processing and the outputs of each step of the process. For example, if the code is supposed to take a value from a user, square it, then output the value, there will be test cases written to check that the user prompt meets the requirements, that the value squares properly, and that the output is displayed according to the requirements.
There have been a few times in my career when testing was done in lower environments, the changes passed all the tests. Sometimes hundreds of test cases were tested and passed. The changes were tested thoroughly and the business users signed off on the results. However once the code was placed into the production environment and the processes were run, catastrophe struck!
Proper integration testing would probably have found the problems before the changes were promoted to production. However sometimes there are obstacles to proper and thorough integration testing. Some of the problems I've encountered before are:
Lack of a proper testing environment - Some IT shops don't have enough resources to have a dedicated integration testing environment. Some shops have a testing environment but for one reason or another the environment is locked down and no testing is allowed.
Not enough time to test properly - Most IT projects are on very tight timelines and just don't provide enough time to test properly. When timelines get tight, the extra time needed generally comes from the testing cycles, which means testing generally suffers.
Not enough understanding of downstream systems - In complex environments it is difficult to estimate the impact of changes to all downstream systems. Sometimes data is extracted and sent to other systems and it can be difficult to determine where the data may be used.
Most projects are properly and thoroughly tested, or are isolated enough that there isn't any impact to other processes. However, occasionally there are circumstances that prevent proper testing. Unfortunately when these cases occur, it can stop production processing for some time and take many extra man hours to correct this issue. Correcting the issue after the problem occurs is not a good substitute for proper and thorough testing up front.