Sorry, I am new to category theory (actually all fields of math...). When I was learning the concept of monoid in college, the identity element is roughly defined as "an element e of set which satisfy $e * a = a = a * e$, for every a in that set". But when I am learning this concept again for understanding monad. The identity element of monoid is defined as a morphism (see here). Could anyone please explain why these two definitions of monoid (in particular the identity of monoid) are equivalent. Thanks!
Some other definition that represents the identity of monoid as morphism: