Although the secret to their creation has since been lost, most Jedi holocrons were created to store and protect the knowledge of the Jedi order. This allowed the chronicles of the past to survive the ages, and has made it possible for future generations to learn directly from Jedi masters centuries after their death.
Jedi Holocrons in particular were designed so that a user may only access information that they are prepared to receive. The gatekeeper possesses a measure of Force awareness that is able to determine not only the users relationship with the Force, but also the depth of their understanding. This effectively protects a padawan from accessing any dangerous information, as well as prohibits advanced Jedi techniques from falling into the hands of the Sith.