The evolution of sex
Although bacteria simply multiply by dividing into two, they also often exchange genetic material, usually by releasing small fragments called plasmids which can be absorbed by nearby bacteria. In this way, beneficial mutations are shared. This might arguably be considered to be the earliest form of sex.
After the appearance of plants and animals in the oceans around 600 million years ago, the only practical way for these new multi-celled sea-creatures to reproduce was by releasing seeds or eggs, whose cells would then begin dividing, sticking together, and changing each time they divided, until finally forming a new adult.
http://www.evolutionary-philosophy.net/sex.html