When you set up a mutual fund you can specify how you want its "cost basis" to be tracked. If you don't select anything, your default is Average Cost, and First-In/First-Out. Translated, they just calculate your average cost per share, and assume that the first shares you bought were the ones you sold. Record keeping is very simple, but you have no flexibility in taxes (you pay the most.)
In my opinion, you want to select "Specific Identification." This means that every time you buy into the mutual fund, you create a "tax lot" for that date, number of shares, and price. When you sell, you specify which tax lot(s) you want to sell. That lets you decide how much tax you want to get hit with (maximize or minimize your capital gains.)
An example of this flexibility -- if you bought repeatedly over a ten year period, you probably have lots of capital gains, especially from your earliest purchases. If the market drops, your most recent purchases may be showing a loss, even if your overall account is showing a gain. You can sell those losing tax lots to harvest the losses (so you can report it as a loss, reducing your tax bill.) Your profitable positions would be left alone. (If you do this, google "Tax Loss Harvesting" to learn about wash sale rules and how to do this properly.)
You can change your cost basis if you didn't select it when you opened the account. Also, you have to select or validate the cost basis for each individual mutual fund you buy.
Vanguard's FAQ on this is here:
https://personal.vanguard.com/us/help/FAQCostBasisContent.jsp