Let A' = A * transpose(A).
A'[i,j] is the inner product of the ith row of A and the jth row of A. Suppose these two look like the following:
row(A,i) = [0, 0, 1, 0, 1, 1, 0, 1]
row(A,j) = [1, 0, 1, 1, 0, 1, 1, 0]
The element-wise product of these two is
row(A,i) .* row(A,j) = [0, 0, 1, 0, 0, 1, 0, 0]
The inner product of the two rows is the sum of these values, 2. This is the intuition for why A'[i,j] is the number of shared connections between row i and row j.
If you look at transpose(A) * A, you will similarly be able to find shared connections between columns.