Quality of a software product is one of the most risky aspects of any software development project. If required quality level for the software product you are building is not achieved then the software project will be at risk of being termed failed.
Software testing helps in achieving the required software quality level. It identifies the software defects which are present in the software product being built so that they can be fixed. A good and effective software testing effort will identify most of the software defects so that they can be fixed. If on the other hand, the software testing effort is not effective or no proper software testing effort is deployed on a software project then the software product will be shipped to the customer with all those serious defects. In this situation, the end users will not be able to use the software products or at least will have a lot of difficulty in using it. This will result ultimately in providing costly customer support which may be prohibitively expensive. In this case, the software vendor or the software service provider who built the software product will lose market credibility as well as may have to bear the cost of that expensive customer support.
In the end, a good and effective software testing helps in avoiding this bad situation and thus helps in avoiding this risk.