The official names of the different versions are "Java Edition" and "Bedrock Edition".
Java Edition is the one that lets you run your own server, is more moddable, and works on Windows, Mac, and Linux.
Bedrock Edition is the one that works on Windows, consoles, and mobile. People can invite people into their own world as long as they're online. Your only private server option is Realms, which is a subscription service. (Edit: Apparently there is finally publicly-available server software for Bedrock Edition. I doubt it's very moddable though, so don't expect to be able to run a public server with all the modded tools you'd expect if you were familiar with running Java Edition servers. Also, I don't think the console versions of Minecraft can join arbitrary servers.)
The Java Edition and Bedrock edition are not cross-compatible with each other. They are fully compatible within each-other though. Bedrock Edition supports cross-play between different consoles and PC, etc.