Typically, such consensus is reached after one or more reviews by the stakeholders on the project at hand after having negotiated a cost-effective way to achieve the requirements the software needs to fulfill.
In the ordered industrial software engineering life-cycle (waterfall model), functional specification describes what has to be implemented.
The next, Systems architecture document describes how the functions will be realized using a chosen software environment.
In non industrial, prototypical systems development, functional specifications are typically written after or as part of requirements analysis.
One popular method of writing a functional specification document involves drawing or rendering either simple wire frames or accurate, graphically designed UI screenshots.