How do `and`/`or` operators work between numbers (or even strings)?

```
5 and 7  # this returns 7
7 and 5  # this returns 5
21 and 4 # this returns 4
4 and 21 # this returns 21

```

How does the `and` operator work in such cases?