A prototype can test untried technology and help predict a project's duration. If you learn that the new technology won't do what you need, or if you conclude that the application will take too long to build, you can decide to cancel the project.
Many companies consider canceling a project after the prototype stage to be a failure. Actually this is probably the way a prototype can save your company the most money. For a few thousand dollars of development, you can save hundreds of thousands or even millions of dollars. The payback can be enormous. A huge number of software projects are canceled late in the development process after spending a fortune in development money. More are finished and then declared failures because they don't do what the customer needs properly and reliably. Canceling a project after the prototype is cheap.
Of course, if you cancel the project, you still haven't built the software the customer needs. Many projects start with the assumption that the software is necessary. In that case, you may not be able to cancel the project. If the prototype makes the project seem unfeasible, however, you should step back and take another look at the problem. You may need to reduce the scope of the project or redesign the application architecture. You may even need to build another prototype to see if the new solution will work. Such major changes may be painful now, but they will be far less painful than having 20 developers spend a couple years building a system that is then totally scrapped.