Multiple PCIe Functions in Real User Applications (EP mode)
Having multiple functions can be useful when the same device does multiple things. For instance my NVIDIA GPU is a single PCIe device with 4 functions. The output of lspci for that device on my PC looks like this:

$ lspci -s 1:00 -k
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 Rev. A] (rev a1)
    Subsystem: ASUSTeK Computer Inc. TU106 [GeForce RTX 2060 Rev. A]
    Kernel driver in use: nvidia
    Kernel modules: nvidia
01:00.1 Audio device: NVIDIA Corporation TU106 High Definition Audio Controller (rev a1)
    Subsystem: ASUSTeK Computer Inc. TU106 High Definition Audio Controller
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel
01:00.2 USB controller: NVIDIA Corporation TU106 USB 3.1 Host Controller (rev a1)
    Subsystem: ASUSTeK Computer Inc. TU106 USB 3.1 Host Controller
    Kernel driver in use: xhci_hcd
    Kernel modules: xhci_pci
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU106 USB Type-C Port Policy Controller (rev a1)
    Subsystem: ASUSTeK Computer Inc. TU106 USB Type-C Port Policy Controller



All four of these functions are located within the same PCIe device (and chip!) but they get separated. In fact, you can see from the output above that all four functions have different kernel modules ("drivers") attached to them. In this case, having the function field just means that all four of these devices get to share the same PCIe infrastructure.

Another example I've seen where this is used is for multi-port network cards. This effectively allows the user to work with each port separately. In the specific case of network cards, this makes it really easy to pass one network card to a virtual machine in a server, for instance. The now ancient Intel 82571EB takes advantage of this, for instance. 

What's really happening here is something like this:

-------                    ------------------
| CPU | &lt;=(INTERNAL BUS)=&gt; | PCIe ROOT PORT |
-------                    ------------------
                                   ^
                                 (PCIe)
                                   v
                           ------------------
                           |  PCIe EndPoint |
                           ------------------
                          ^             ^
                (On-silicon internal buses and magic)
                         v              v
                ----------------     ----------------
                | Network card |     | Network card |
                |       A      |     |      B       |
                ----------------     ----------------


The main processor (or root port, technically) is able to see each of the far-end "functions", while only one PCIe connection is needed.