The background to the story is as follows: When Moshe passed on the mantle of leadership to Yehoshua, he placed his hand on his head. The Torah says (Bamidbar 27:18-21)
And the LORD said unto Moses: 'Take thee Joshua the son of Nun, a man in whom is spirit, and lay thy hand upon him
and set him before Eleazar the priest, and before all the congregation; and give him a charge in their sight.
And thou shalt put of thy honour upon him, that all the congregation of the children of Israel may hearken.
And he shall stand before Eleazar the priest, who shall inquire for him by the judgment of the Urim before the LORD; at his word shall they go out, and at his word they shall come in, both he, and all the children of Israel with him, even all the congregation.'
Since that time Rabbinic leaders were inducted by someone who already had semicha from the previous generation, with the approval of the Nassi (political leader). In addition, this semicha could only be given and received in Eretz Yisrael. For this reason the Babylonian Amoraim in the Talmud are never called 'Rabbi' but always 'Rav' (or sometimes simply by their name - for example Shmuel).
Only someone with semicha was permitted to rule on cases of fines (knasot) and some other kinds of rulings. In addition, the Sanhedrin (both the main Sanhedrin in Jerusalem, and the smaller Sanhedrins in each town) could only convene if at least one of their number had semicha.
When the Romans took control of Israel they banned semicha and threatened to kill anyone giving or receiving semicha. The Talmud (Sanhedrin 14a) records how Rabbi Yehuda ben Bava gave up his life in order to give semicha to five of his students, who became the leaders and decisors of Judaism - Rabbi Meir, Rabbi Shimon, Rabbi Yehudah (ben Ila’i), Rabbi Yosi and Rabbi Elazar ben Shamua.
Despite this sometime in the 4th or 5th century the Romans succeded in banning semicha and dismantled the Sanhedrin. This was probably because the greatest Rabbis, the ones who would have been worthy of receiving semicha, were no longer residing in Israel. The centres of Torah had moved to Bavel.
Since that time there has been no semicha (what is today called semicha is named that in memory of the authentic semicha which was traced back to Moshe).
However, Rambam writes in two places that if all the Rabbis of Israel would agree, they could jointly give semicha to someone, and restart the process. He writes in his commentary on the Mishna (Sanhedrin 1:1) and Mishne Torah (Hilchot Sanhedrin 4:11):
נראין לי הדברים, שאם הסכימו כל החכמים שבארץ ישראל למנות דיינין ולסמוך אותן--הרי אלו סמוכין, ויש להן לדון דיני קנסות, ויש להן לסמוך לאחרים. אם כן, למה היו החכמים מצטערין על הסמיכה, כדי שלא ייבטלו דיני קנסות מישראל: לפי שישראל מפוזרין, ואי אפשר שיסכימו כולן; ואם היה שם סמוך מפי סמוך, אינו צריך דעת כולן, אלא דן דיני קנסות לכול, שהרי נסמך מפי בית דין. והדבר צריך הכרע.
It appears to me [Maimonides] that if all the sages of the Land of Israel consent to appoint dayanim (judges) and grant them semichah (ordination), they have the law of musmachim and they can judge penalty cases and are authorized to grant semichah to others [thus restoring Biblical ordination].
If so, why did the sages bemoan [the loss of] semichah? So that the judgment of penalty cases wouldn't disappear from among Israel because Jews are so spread out that it's not possible to get their consent [to authorize a dayan]. If someone were to receive semichah from someone who already has semichah, then he does not require their consent – he may judge penalty cases for everyone since he received semichah from beis din (rabbinical court). However, this matter requires a final decision.
(Translation from wikipedia's website)
(Paranthetically - I just found that you can download two sedarim of Rambam's commentary on Mishna IN HIS OWN HANDWRITING from this website. WOW!)
Based on this view of Rambam, R' Yaakov Bei Rav tried to reinstate semicha in Tzfat in 1538 by getting the agreement of all the Rabbis of Israel.
It is getting late, so I'll just copy and paste what wikipedia has to say on the matter:
In 1538 Rabbi Jacob Berab of Safed, Land of Israel, attempted to restore the traditional form of Semikhah. His goal was to unify the scattered Jewish communities through the re-establishment of the Sanhedrin. At his prompting, 25 rabbis from the land of Israel convened; they ordained Jacob Berab as their "Chief rabbi". Berab then conferred semikhah through a laying on of hands to four rabbis, including Joseph Caro, who was later to become the author of the Shulchan Aruch, widely viewed as the most important code of Jewish law from the 17th century onwards. Joseph Caro in turn ordained Rabbi Moshe Alshich, who in turn ordained Rabbi Hayyim Vital.
Berab made an error in not first obtaining the approval of the chief rabbis in Jerusalem, which led to an objection to having a Sanhedrin at that time. One should note that this was not an objection to the semikhah, but to reinstituting a Sanhedrin. Levi ibn Habib, the chief rabbi in Jerusalem, wrote that when the nascent Sanhedrin took the authority of a Sanhedrin upon itself, it had to fix the calendar immediately. However, by delaying in this matter, it invalidated itself. Rabbi David ibn abi Zimra (Radvaz) of Egypt was consulted, but when Berab died in 1542 the renewed form of semikhah gradually ground to a halt.
If you have spare time over Shabbat and want to read the dialogue between R' Yaakov Bei Rav and R' Levi Ibn Chaviv (who was the father of the author of Ein Yaakov) it is recorded in the Responsa of R' Levi Ibn Chaviv. It is quite a lengthy discussion of the subject (just under 50 pages) and I have not yet gone through most of it. (actually I just found another wikipedia page which summarizes the main arguments)
I wonder whether semicha gave the Shulchan Aruch more authority, and gave R' Yosef Karo the ability to complete such a task. I also wonder what could have happened if politics and machlokes had not got in the way of halacha.
The final question is what, if any, implications this event in history has for the Sanhedrin of today.
One very final note - I visited the Mossad HaRav book sale this week (as I do every year - though this year for the first time ever I didn't actually purchase anything). You may be familiar with the building on the corner at the entrance to Jerusalem. I seem to remember once being told that when the State was established, Rav Yehuda Leib Maimon tried to create a Sanhedrin, and this semi-circular building was originally intended to house that Sanhedrin (since the Old City was not under Jewish control at the time. And the Sanhedrin sits in the shape of a semi-circle).