Around you are lots of early eukaryotes[1]. They are really big, compared to you.
Also, they need to move around - their energy demands are so high that they can’t just wait around and hope. To this end, any change which makes them able to move, no matter how small, will be copied around the community. Eventually, those small changes add up to something called a flagellum.
However, this flagellum needs a lot of energy.
They can detect the presence of chemicals they can use, and move toward them using their flagellae. The sea is full of tiny little prokaryotes like you. You are made of chemicals…
The eukaryotes engulf smaller things, such as you, a prokaryote, which they want to take apart, and consume the energy, but on at least one occasion, something really odd happens.
Perhaps your outer wall is a little thicker, or perhaps the eukaryote eating you doesn’t have the right chemistry to eat through it, but anyway, it eats you… and you survive!
You’re inside another organism. Ewwwww.
You live on inside the eukaryote, and, protected from most other threats, eventually you lose the genes you aren’t using. What is left, is a pretty simple thing, no longer an organism, but an organelle. You are called a mitochondrium, and you are part of a Eukaryote.
With enough mitocondria inside it, it has plenty of energy. It might even have enough to drive two flagellae. It could really motor along!
[1]They chose to use histone to spool up their DNA, which is really efficient. They have been able to acquire lots and lots of genes, and a thin cell wall which enables them to convert a wide variety of chemicals into energy.