A resistor of R ohms between A and B will show up in the matrix as
The rows represent the voltage on A and B; the columns represent the net current into nodes A and B.
The columns must be equal and opposite because the current flowing into one node of the resistor must be equal and opposite the current flowing out the other node. The two numbers in each column must be equal and opposite because current should only flow in the resistor in response to a voltage difference between the two nodes. The value of the the upper-left cell is 1/R because an increase on A's voltage of 1 volt should increase the current flowing into A by 1/R.
The opposite signs of the diagonal and off-diagonal non-zero entries in the matrix follows from the discrete laplacian associated with combining a linear consitutive relation (Ohm's law) with a conservation law (kirchoff's law). Laplacians are always symmetric positive definite.