My Algebra textbook "Chapter 0" by Aluffi states that the category of a group consists of groups as objects and homomorphisms between them as morphisms.
Then it also gives a commutative diagram to encapsulate the properties of a homomorphism: namely that if $f:G\to H$ is a homomorphism, then $f(a*_G b)=f(a)*_H f(b)$.
Is the commutative diagram part of the category theory definition? Or is it an additional property which along with the category theory definition (taking groups as objects and homomorphisms as morphisms) gives the full definition of a group?
Motivation: I thought categories could only contain objects and morphisms. Hence now it seems rather surprising that you could also include special relationships between objects of a category to encpasulate the properties of an Algebraic structure.
Thank you.