I am aware that the phrase 「おかわり」 that is used when asking for second helping (of meals especially) is an idiomatic expression, so its usage is understood as it is. But, I'm curious about the origin of this phrase because it seems to be derived from 替わる / 代わる(P) / 換わる, which means "to be exchanged/switched". How did this phrase come into the usage? Is it the case that in the past when people asked for second helping, something was exchanged (bowl, chopsticks etc)?
It means 'replacement'. What is being replaced is the content, not the container. You can use a related expression