To the best of my knowledge, it's pretty simple. They have expenses to run the fund. They remove this money from the fund as needed to pay their bills. At the end of the year they add up the amount they removed, divide it by the assets in the fund, and that's the expense ratio.