tldr; some old guy thought that because the buddha was now passed into parinirvana, the monks could go crazy and do whatever they wanted, not adhering to the rules. so a council was called consisting of 500 arahants to codify the buddhas teachings and rules for the sangha so that going forth the dharma would not degenerate. Ananda, being foremost in memory and having heard nearly all of the buddhas teachings as he was the buddhas #1 monk, was asked to join but only if he was able to attain arahantship. So Ananda stayed up all night the night prior to the council, and finally on the morning of, attained Arahantship, and was able to attend and recite all the sutas and precepts for the sanga.
The First Buddhist council was convened in the year following the Buddha's parinirvana,1 which is 543–542 BCE according to Theravada tradition, at various earlier dates according to certain Mahayana traditions, and various later dates according to certain Western estimates.[2] According to late commentarial accounts, King Ajatashatru (Sanskrit अजातशत्रु) sponsored the council. Tradition holds that on the full moon day of Shravan lunar month the Council was held in a hall erected by Ajatasattu outside the Sattaparnaguha (Pali: Sattapanniguha) or Saptaparni Cave in Rajgir, three months after the Buddha had attained parinirvana (i.e. died). Detailed accounts of the council can be found in the Khandhaka sections of the canonical Vinayas.
However other sources reveal that the Buddha's parinirvana happened 218 years before the coronation of Emperor Ashoka. Emperor Ashoka was coronated in 269 BCE. So it can also be stated that the Buddha died in 483 BCE. The time matches the reign of King Ajathashatru. Hence it can also be argued that the First Buddhist Council was held in the year 483 BCE.
According to this record the incident which prompted the Elder Mahakassapa to call this meeting was his hearing a disparaging remark about the strict rule of life for monks. The monk Subhadda, who had ordained late in life, upon hearing that the Buddha had expired, voiced his resentment at having to abide by all the rules for monks laid down by the Buddha. Many monks lamented the passing of the Buddha and were deeply grieved but Subhadda spoke up to show happiness and relief that Buddha was gone.
And Subhadda, the late-received one, said to the Bhikkhus: "Enough, Sirs! Weep not, neither lament! We are well rid of the great Samana. We used to be annoyed by being told, 'This beseems you, this beseems you not.' But now we shall be able to do whatever we like; and what we do not like, that we shall not have to do."[3]
Mahakassapa was alarmed by his remark and feared that the Dhamma and the Vinaya might be corrupted and not survive intact if other monks were to behave like Subhadda and interpret the Dhamma and the Vinaya rules as they pleased. To avoid this he decided that the Dhamma must be preserved and protected. To this end after gaining the Sangha's approval he called to council five hundred Arahants.[3] Ananda was to be included in this provided he attained Arahanthood by the time the council convened.
With the Elder Mahakassapa presiding, the five hundred Arahant monks met in council during the rainy season. The first thing Mahakassapa did was to question the foremost expert on the Vinaya of the day, Venerable Upali on particulars of the monastic rule. This monk was well qualified for the task as the Buddha had taught him the whole of the Vinaya himself. The Elder Mahakassapa asked him specifically about the ruling on the first offense parajika, with regard to the subject, the occasion, the individual introduced, the proclamation, the repetition of the proclamation, the offense and the case of non-offense. Upali gave knowledgeable and adequate answers and his remarks met with the unanimous approval of the presiding Sangha. Thus, the Vinaya was formally approved.
The Elder Mahakassapa then turned his attention to Ananda in virtue of his reputable expertise in all matters connected with the Dhamma. Happily, the night before the Council was to meet, Ananda had attained Arahantship and joined the Council.1[4] The Elder Mahakassapa, therefore, was able to question him at length with complete confidence about the Dhamma with specific reference to the Buddha's sermons. This interrogation on the Dhamma sought to verify the place where all the discourses were first preached and the person to whom they had been addressed.
Ananda aided by his word-perfect memory was able to answer accurately and so the Discourses met with the unanimous approval of the Sangha. The First Council also gave its official seal of approval for the closure of the chapter on the minor and lesser rules, and approval for their observance. It took the monks seven months to recite the whole of the Vinaya and the Dhamma and those monks sufficiently endowed with good memories retained all that had been recited. This historic first council came to be known as the Pancasatika because five hundred fully enlightened Arahants had taken part in it.
https://en.wikipedia.org/wiki/First_Buddhist_council
buddhanet.net/e-learning/buddhism/lifebuddha/2_32lbud.htm