Why scalar products in the algebraic Bethe ansatz have determinant representation