What it's for
Port 5900 is the default port for VNC (Virtual Network Computing), a cross-platform protocol for graphical remote desktop access. Unlike RDP, which is Windows-native, VNC works across Windows, macOS, and Linux fairly uniformly, making it a common choice for mixed-OS environments and for remotely accessing Linux desktops, which don't have RDP built in the way Windows does.
Protocol basics
VNC runs over TCP, streaming framebuffer updates (essentially, the screen's pixel data) from the remote host to the connecting client, along with relaying keyboard and mouse input back. Historically, VNC's built-in security has been considered weaker than RDP's — some implementations default to weak or optional authentication, and encryption isn't always guaranteed depending on the specific VNC server software in use. Because of this, VNC connections are commonly tunneled through SSH or a VPN for anything beyond a fully trusted local network, rather than relying on VNC's own security features alone.