calculation of a fund NAV

Hello,

How is the NAV of a fund calculated? Do they use the MID? Anyone know the backstory of NAV? Why not investors entering the fund pay the sum of the ask of the funds assets, and investors leaving get the sum of the bid of the funds assets… Is the NAV just there to simplify things… I somehow see this simplification having an impact, but I can only think of that once I know more about it…

Thanks