A complete classification of all finite bijective set-theoretic solutions (S,s) to the Pentagon Equation is obtained. First, it is shown that every such a solution determines a semigroup structure on the set S that is the direct product E\times G of a semigroup of left zeros E and a group G. Next, we prove that this leads to a decomposition of the set S as a Cartesian product X\times A\times G, for some sets X,A and to a discovery of a hidden group structure on A. Then an unexpected structure of a matched product of groups A,G is found such that the solution (S,s) can be explicitly described as a lift of a solution determined on the set A\times G by this matched product of groups. Conversely, every matched product of groups leads to a family of solutions arising in this way. Moreover, a simple criterion for the isomorphism of two solutions is obtained. The results provide a far reaching extension of the results of Colazzo, Jespers and Kubat, dealing with the special case of the so called involutive solutions. Connections to the solutions to the Yang–Baxter equation and to the theory of skew braces are derived.