The average of a set of numbers is their sum divided by how many there are. That definition is all you need, but most exam questions are faster if you think in terms of the total rather than the average itself:
Total = average × number of items
When a member joins, leaves or is replaced, the total changes by a known amount. Tracking that change is quicker than recalculating the whole average, and it avoids long additions.