When we talk about relations in context of mathematical logic, they are predicates that are contained in the signature of a certain language. For example the signature of ordered fields is:
$$\sigma=\{+,\times,0,1, > \}$$
Where $+,\times,0,1,$ are functions of arity 2,2,0,0 and $>$ is a relations symbol of arity 2. Here the symbol "$>$" is also called a predicate and $>(xy)$ is interpreted as "$x$ is greater then $y$" So this is just a sentence that is either true or false, therefore can be thought of as a boolean valued function as also explained on Predicate vs function.
Now what causes confusion to me is the definition of a relation as the cartesian product of two sets: "everything that is a subset of $A\times B$ is a relation." Furthermore, functions are defined just as certain subset of this cartesian product. So accoring to this definition functions are just a subset of a wider concept - relations.
But how the first and the second usage of relation go together? In the first usage there is a clear disticntion between relations and functions, relations take certain elements from doamin of discourse and make a statement out of them, which can take only two values, true or false, functions associate certain elements with others. In the second usage, on the other hand, functions and relations are very similar consepts, functions are just a certain type of relations. So do these two usages represent different consepts, or am I missing something?