How can a matrix represent a relation when a relation is not a function? A matrix can represent a relation (https://en.wikipedia.org/wiki/Logical_matrix). How is this so? Since matrices are a representation of linear maps, does this mean that a linear map is not necessarily a function?

Don’t confuse the representation with the thing being represented. A PNG image might show a portrait of person, or a rendered math equation. Both are grids of pixels but that doesn’t mean that human faces are types of math equations (or vice versa).
Similarly a matrix is just a rectangular grid of numbers. Linear maps can be expressed using matrices, but so can many other, unrelated, things. Binary relations can be expressed as a matrix of 0s and 1s, and this representation is fruitful since it lets us express new ideas (composition of relations) in terms of old ones (matrix multiplication). But a matrix of numbers might represent a linear map, or might represent a binary relation, and the two are not the same.
