It used to be a lot longer between the election and the inauguration because communication was so slow in the 18th and 19th centuries that it would be months before word got out to every state who had won the election.
The lame duck session between election and inauguration is used in modern times for the incoming president to put together their team and become familiar with the mountains of information, especially classified information, that they need to know to govern. It enables the new administration be ready on Day One to run the country with no interruption between the former administration and the new administration.