### Summary

There is an undocumented gotcha in path_join. It is probably just a side effect of os.path.join's behaviour.

For a sparse backup task I had two tasks:
```
- ansible.builtin.file:
    state: directory
    path: "{{ (backup_dir, item) | path_join }}"
  loop: "{{template_dirs}}"
- ansible.builtin.copy:
    remote_src: true
    src: "{{item}}"
    dest: "{{ (backup_dir, item) | path_join }}"
  loop: "{{ templates | map(attribute='dest') }}
```
`template_dirs` is a list of relative paths, `templates.dest` is the absolute path of the destination config. For the first task, path_join resulted in `/tmp/somedir/directory/in/list`; for the second, it produced `/directory/in/list/filename`. `(backup_dir, item[1:]) | path_join` produced the expected result of `/tmp/somedir/directory/in/list/filename`.

The documentation for the path_join filter should be clear that a list entry with an absolute path overrides earlier elements in the list, and there should be an example of it doing that.

### Issue Type

Documentation Report

### Component Name

lib/ansible/plugins/filter/core.py

### Ansible Version

```console
$ ansible --version
ansible [core 2.15.2]
  config file = None
  configured module search path = ['/home/rorsten/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rorsten/miniconda3/lib/python3.11/site-packages/ansible
  ansible collection location = /home/rorsten/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rorsten/miniconda3/bin/ansible
  python version = 3.11.4 (main, Jul  5 2023, 13:45:01) [GCC 11.2.0] (/home/rorsten/miniconda3/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = None
```


### OS / Environment

Ubuntu 16.04, 20.04; MacOS 12.6.7

### Additional Information

It is not unreasonable to expect that the output of list | path_join would be the concatenation of all of the path elements in the list, but this seems not to be the actual behaviour. The clarification could prevent quite a bit of frustration.

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
else:
        raise AnsibleFilterTypeError('subelements must be a list or a string')
    results = []
    for element in element_list:
        values = element
        for subelement in subelement_list:
            try:
                values = values[subelement]
            except KeyError:
                if skip_missing:
                    values = []
                    break
                raise AnsibleFilterError("could not find %r key in iterated item %r" % (subelement, values))
            except TypeError:
                raise AnsibleFilterTypeError("the key %s should point to a dictionary, got '%s'" % (subelement, values))
        if not isinstance(values, list):
            raise AnsibleFilterTypeError("the key %r should point to a list, got %r" % (subelement, values))
        for value in values:
            results.append((element, value))
    return results
def dict_to_list_of_dict_key_value_elements(mydict, key_name='key', value_name='value'):
    ''' takes a dictionary and transforms it into a list of dictionaries,
        with each having a 'key' and 'value' keys that correspond to the keys and values of the original '''
    if not isinstance(mydict, Mapping):
        raise AnsibleFilterTypeError("dict2items requires a dictionary, got %s instead." % type(mydict))
    ret = []
    for key in mydict:
        ret.append({key_name: key, value_name: mydict[key]})
    return ret
def list_of_dict_key_value_elements_to_dict(mylist, key_name='key', value_name='value'):