Note that $B$ is equal to the determinant of the second matrix; $A$ is equal to the determinant of the first matrix. Have you tried computing the determinant of each to see that we get B = 27A?
A is not a matrix, B is not the matrix.
We do have that the matrix for which the determinant equals B, call it $B_M = 3 A_M$, where $A_M$ is the matrix whose determinant is equal to A. But, $\det B_M = 3^3 \det A_M$
Recall, that when finding the determinant of a matrix, if a row of one matrix is multiplied by a scalar $c$, then the determinant $B$ of the resulting matrix $ 3\det A$: for EACH row. Here, you have three rows in the second matrix that are each a multiple of a row in the first matrix, hence we have $$ B = 3\cdot 3\cdot 3 A = 3^3 A = 27 A$$