Invariant needs to remain the same, regardless of how many ST tokens have been taken away from the pool (i.e. bought) or added to it (i.e. sold). So in order to keep the k variable as const, the right side of the pool (m) needs to be adjusted along every trade affecting the left side of the pool (p).