Following the discovery of Terrium some, 6000 years ago, the human race challenged itself to a technological arms race. They eventually came to discover firstly, weapons harsher than anything built before. Bombs that can level an entire country, or even halve an entire continent. After which, they came to discover using Terrium as a means of propulsion which somehow worked faster than light.
Along with this technological arms race, they also discovered Ambrosia. A method of creating synthetic humanoid babies that undergo a growth cycle, thereby creating living, breathing humans. Their only problem was that these "humans" were mindless. And only existed as a vessel for a memory chip containing a specifically programmed A.I. These saw the first usage of machines.
The machines, after frequent usage all across the galaxy, their mistreatment coalescing into the First Machine War. Whereupon trillions of machines rose up against their human overlords. Trillions died all across the galaxy, and countless planets were purged and destroyed.
The machines were dominant, only being defeated due to a crack in their system. A leak discovered on one of their fallen comrades. Which, after much analysis, showed the entire machine's servers. All of their combined consciousness working along with one another, showing that once one dies. Their consciousness, memory, etc. All remain intact and would be transferred to these servers. Had we not discovered this, we may perhaps have ultimately lost to the endless horde of Machines. This is why, after finding their consciousness server, they were promptly shut down which ended the First Machine War.
The discovery of the Machine's consciousness servers led to the research upon human consciousness. With a bit of Terrium manipulation, they've managed to find traces of human consciousness visibly leaving a dying body. After a few more years of research, they've made a breakthrough. the discovery of the Noosphere. A sphere that frequently shrinks and expands in relation to humanity's expansion across the galaxy. It acts less like an actual sphere and more of an interconnected cloud of consciousness throughout the occupied galaxy.
Eventually, they discovered a way to focus this consciousness and store them as bits of data into a server. This data is then implemented upon a memory chip, and, once used into an Ambrosian vessel, managed to perfectly impart a new body to an already dead person. And with that we have discovered immortality.