It is proven that finite idempotent left non-degenerate set-theoretic solutions $(X,r)$ of the Yang–Baxter equation on a set $X$ are determined by a left simple semigroup structure on $X$ (in particular, a finite union of isomorphic copies of a group) and some maps $q$ and $ǎrphi_x$ on $X$, for $xın X$. This structure turns out to be a group precisely when the associated Yang–Baxter monoid $M(X,r)$ is cancellative and all the maps $řphi_x$ are equal to an automorphism of this group. Equivalently, the Yang–Baxter algebra $K[M(X,r)]$ is right Noetherian, or in characteristic zero it has to be semiprime. The Yang–Baxter algebra is always a left Noetherian representable algebra of Gelfand–Kirillov dimension one. To prove these results, it is shown that the Yang–Baxter semigroup $S(X,r)$ has a decomposition in finitely many cancellative semigroups $S_u$ indexed by the diagonal, each $S_u$ has a group of quotients $G_u$ that is finite-by-(infinite cyclic) and the union of these groups carries the structure of a left simple semigroup. The case that $X$ equals the diagonal is fully described by a single permutation on $X$.