"TUN" and "TAP" devices are used when you want to implement a virtual network adapter from user mode. They are usually used by VPN software but they can also be used to implement other network functionality such as NAT46 and NAT64.
The difference between "TUN" and "TAP" interfaces is the layer thay work at. "TUN" interfaces send and receive IP packets with no further encapsulation and no attempt to translate layer 3 next hop addresses to layer 2 addresses. "TAP" interfaces send and receive Ethernet frames with source and destination MAC addresses.
The main alternative to "TUN" and "TAP" interfaces is implementing the VPN in the kernel. This is likely to perform better but increases security and reliability risks and makes development more difficult.