When does a caterpillar become a pupa?

every insect stage has a moult. it is just that people for some reasons assume that from larva to pupa, you add layers (some sort of cocoon) when in reality pupa is what lies underneath and you need to moult.