If it is another OS then how was the first OS made?
The short version is this:
- elementary is based on Ubuntu.
- Ubuntu is based on Debian.
- Debian was one of the first Linux distros.
Each distro takes the foundation laid by the previous one and uses it to build something new.