$R=\{(1,2),(1,3)\}$ is a relation but not function.
The logic for this is that if the first element of every ordered pair must remain different, then it is said to be function. Otherwise, it's just a relation.
My question is what is the background of this distinction?
Part of the reason is "historical".
Function is a typical mathematical concept and has its origin in the idea of "recipe" or "procedure" which, taking an input $x$ "produce" an output $y$.
Paradigmatic examples are the simple mathematical functions like : "double of __" (i.e. $y = 2 \times x$), "square of __" (i.e. $y = x^2$).
The concept of relation is easily encountered outside of mathematics; we are all accostumed with everyday relations like : "__ is father of ..." or "__ is to the left of ...".
Only in modern times (about one century ago), the adoption of set-theoretic language in mathematics, gives us the opportunity of "modelling" relations as set of ordered pairs and thus to define functions simply as a "special" kind of relations : those satisying the "functionality" property :