What it contains
A code editor, the iOS Simulator, a visual interface builder, debugging and performance profiling tools, and the machinery for code signing and archiving a build for the App Store.
The Mac requirement
Xcode runs only on macOS. That is why an agency building your iOS app needs Apple hardware, and why a Windows-only team cannot publish to the App Store without a cloud Mac service.
What to watch
- Xcode versions are tied to iOS versions. Apple regularly requires submissions to be built with a recent Xcode, so projects need periodic updates.
- Installs are large and updates are frequent, so build machines need spare disk space.
- Signing problems (expired certificates, mismatched profiles) cause more lost afternoons than the code itself.
Questions, answered
Yes, it is a free download from the Mac App Store. Publishing to the App Store needs a paid Apple Developer Program membership.
Yes, at least for the final iOS build, signing and upload, and for debugging device-specific problems.