What is the Test Plan for Software Testing?

Imagine you and your team of software developers have worked day and night on a product for weeks, months and even a few years. You have taken every step and procedure required to develop a product correctly. And you plan to release it within a span of a few days. Now cutting a long story short, your product is released but what happens is that your end-users start using the product. They find lots and lots of glitches while using the app and all of a sudden a huge chunk of the end-users switch to your competitors. So what happened, what exactly went wrong?