It's for tunneling software. See the wikipedia article titled: TUN/TAP for full details.
_excerpt from FreeBSD tun man page_
> The tun interface is a software loopback mechanism that can be loosely described as the network interface analog of the pty(4), that is, tun does for network interfaces what the pty(4) driver does for terminals.
This `socat` documentation page does a good job of showing how they could be used.
_excerpt from socat doc_
> Some operating systems allow the generation of virtual network interfaces that do not connect to a wire but to a process that simulates the network. Often these devices are called TUN or TAP.
### References
* Manual Reference Pages - TUN (4)
* Tun/Tap interface tutorial
* Less widely known features of iproute