Millions if not billions of years ago the known galaxy was ruled by a powerful aquatic apex race resembling massive earth squid called the Leviathan's, with the help of their powerful telepathic abilities which worked very similarly to the reapers indoctrination ability they controlled and used any lesser races they came across as pawns and servants of a sort. It was during this time that the Leviathan's would notice a reoccurring theme among their servants, over and over the 'lesser' races would create machines and AI to assist them, and these creations would continuously end up destroying their masters. It was then that the Leviathan's decided to create an AI of their own to help govern the lesser races and keep them safe, this AI would have one directive which was to "Preserve life at all cost.".
After having created a sort off army on it's own and collected and stored DNA from the various races in the galaxy, the AI eventually recognized the Leviathan's themselves as a part of the problem and turned against them, almost all of the Leviathan's fell prey to their own hubris and were wiped out. At this point the AI used the Leviathan's genetic material to create the very first Reaper, Harbinger.
After having harvested the Leviathan's Harbinger would be used over the next millions of years as a tool to create even more Reapers. Eventually this would become a routine and the number of Reapers would grow, so they settled into a continuous cycle, first they would harvest most if not all of the intelligent life in the galaxy and use the resulting bio matter to create a new Reaper, then they would retreat to the dark space in between galaxies to lie dormant for a while in order to give the various races time to recuperate, repopulate and develop, then they would return once more only to repeat the process.
In order to speed up the development of the lesser races so that they could be harvested more frequently and to some degree in order to control their technological development path the Reapers constructed the Mass Effect Relays and the Citadel for the lesser races to find, unknown to the lesser races these structures and their apparently docile caretakers the Keepers are also used by the Reapers as an aid with their imminent and re occurring invasions. These structures are left intact after each cycle for the next emerging civilizations to discover.
The Reapers were created in 2007 by Bioware as the main threat to the galaxy in their Mass Effect trilogy.