According to Maimonides (Introduction to Mishneh Torah), the baraitot were compiled by Rabbi Hoshaya and Bar Kappara.
Because the Mishnah encapsulates the entire Oral Law in a purposely compact form (designed to both facilitate and necessitate oral transmission), many variant versions, additional explanations, clarifications and rulings were not included in the Mishnah. These were later compiled in works called the "Baraitot"
You shall keep My laws and My rules, by the pursuit of which man shall live: I am the L-RD.
You shall not profane My holy name, that I may be sanctified in the midst of the Israelite people—I the L-RD who sanctify you,
You shall love the L-RD your G-d with all your heart and with all your soul and with all your might.
כי אתא רב דימי א"ר יוחנן לא שנו אלא שלא בשעת גזרת המלכות אבל בשעת גזרת המלכות אפי' מצוה קלה יהרג ואל יעבור
§ When Rav Dimi came from Eretz Yisrael to Babylonia, he said that Rabbi Yoḥanan said: The Sages taught that one is permitted to transgress prohibitions in the face of mortal danger only when it is not a time of religious persecution. But in a time of religious persecution, when the gentile authorities are trying to force Jews to violate their religion, even if they issued a decree about a minor mitzva, one must be killed and not transgress.
The Gemara relates: There were these hooligans in Rabbi Meir’s neighborhood who caused him a great deal of anguish. Rabbi Meir prayed for God to have mercy on them, that they should die. Rabbi Meir’s wife, Berurya, said to him: What is your thinking? On what basis do you pray for the death of these hooligans? Do you base yourself on the verse, as it is written: “Let sins cease from the land” (Psalms 104:35), which you interpret to mean that the world would be better if the wicked were destroyed? But is it written, let sinners cease?” Let sins cease, is written. One should pray for an end to their transgressions, not for the demise of the transgressors themselves. Moreover, go to the end of the verse, where it says: “And the wicked will be no more.” If, as you suggest, transgressions shall cease refers to the demise of the evildoers, how is it possible that the wicked will be no more, i.e., that they will no longer be evil? Rather, pray for God to have mercy on them, that they should repent, as if they repent, then the wicked will be no more, as they will have repented. Rabbi Meir saw that Berurya was correct and he prayed for God to have mercy on them, and they repented.
(ב) והוי מתאבק בעפר רגליהם כיצד בזמן שת״ח נכנס לעיר אל תאמר איני צריך לו אלא לך אצלו ואל תשב עמו לא על גבי המטה ולא על הכסא ולא על הספסל אלא שב לפניו על הארץ וכל דבר שיצא מפיו קבלהו עליך באימה ביראה ברתת ובזיע כדרך שקבלו אבותינו מהר סיני באימה ביראה ברתת ובזיע. דבר אחר הוי מתאבק בעפר רגליהם זה רבי אליעזר ושותה בצמא את דבריהם זה רבי עקיבא. מה היה תחלתו של רבי עקיבא. אמרו בן ארבעים שנה היה ולא שנה כלום. פעם אחת היה עומד על פי הבאר אמר מי חקק אבן זו אמרו לא המים שתדיר [נופלים] עליה בכל יום אמרו [לו] עקיבא אי אתה קורא אבנים שחקו מים. מיד היה רבי עקיבא דן קל וחומר בעצמו מה רך פסל את הקשה דברי תורה שקשה כברזל על אחת כמה וכמה שיחקקו את לבי שהוא בשר ודם. מיד חזר ללמוד תורה. הלך הוא ובנו וישבו אצל מלמדי תינוקות א״ל רבי למדני תורה אחז רבי עקיבא בראש הלוח ובנו בראש הלוח כתב לו אלף בית ולמדה . (אלף תיו ולמדה תורת כהנים ולמדה). היה לומד והולך עד שלמד כל התורה כולה הלך וישב לפני רבי אליעזר ולפני ר׳ יהושע אמר להם רבותי פתחו לי טעם משנה כיון שאמר לו הלכה אחת הלך וישב לו בינו לבין עצמו אמר (אלף זו למה נכתבה בית זו למה נכתבה) דבר זה למה נאמר חזר ושאלן והעמידן בדברים.
(2) What were Akiva's beginnings? It is said: Up to the age of forty, he had not yet studied a thing. One time, while standing by the mouth of a well in Lydda, he inquired, "Who hollowed out this stone?" and was told, "Akiva, haven't you read that 'water wears away stone' (Job 14:19)? - it was water falling upon it constantly, day after day." At that, Rabbi Akiva asked himself: Is my mind harder than this stone? I will go and study at least one section of Torah. He went directly to a schoolhouse, and he and his son began reading from a child's tablet. Rabbi Akiva took hold of one end of the tablet, and his son of the other end. The teacher wrote down alef and bet for him, and he learned them; alef to tav, and he learned them; the book of Leviticus, and he learned it. He went on studying until he learned the whole Torah. Then he went and sat before Rabbi Eliezer and Rabbi Joshua. "My masters," he said, "reveal the sense of Mishnah to me." When they told him one halakhah, he went off to reason with himself. This alef, he wondered, what was it written for? That bet - what was it written for? This teaching - what was it uttered for? He kept coming back, kept inquiring of Rabbi Eliezer and Rabbi Joshua, until he reduced his teachers to silence.