I know how it works, they are called homogeneous transformation matrices and represent rotation, translation and scalation between 2 axis systems. You must notice that they only refer to axis systems, not objects, so you must always have one fixed reference system which is the world, and then each matrix represents subsequent transformations.
1 0 0 0
0 cosA -sinA 0
0 sinA cosA 0
0 0 0 1
this matrix represents only one rotation of A degrees in X axis, so a null rotation gives
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
which is the identity matrix,
cosA 0 sinA 0
0 1 0 0
-sinA 0 cosA 0
0 0 0 1
this matrix is the same but in Y axis
cosA -sinA 0 0
sinA cosA 0 0
0 0 1 0
0 0 0 1
this matrix refers to Z axis
1 0 0 x
0 1 0 y
0 0 1 z
0 0 0 1
this matrix translates a distance given by the vector p(x,y,z)
the element 4,4 represents the scalation factor, and the elements 4,1 4,2 4,3 represents a change in perspective.