The Torah commands that if a Jew wishes to use a non-Jew’s kelim (vessels, cookware, cutlery, dishes, etc.) that had been used for non-kosher, they must render them kosher – or “kasher” them – by the same means they were used with forbidden food, as it is written: “any article that enters fire, you shall pass through fire…and anything that does not enter fire, you shall pass through water” (Bamidbar 31:23). The Sages derive from here that kelim must be kashered in the manner that they are used. If they are used with fire, then they are kashered via libun, in fire. If they are used with boiling water, then they are kashered through hagala in boiling water. If they were only used cold, then they are kashered by rinsing them in cold water (Avoda Zara 74b; 76b). Thus, there are three types of kashering: libun, hagala, and rinsing.
The Sages explained that when one cooks a non-kosher food in a pot, its taste is absorbed in the walls, and if one later cooks a kosher food in the same pot, the non-kosher taste will be released from the walls of the pot and enter the kosher food, rendering it forbidden. To remove the taste absorbed in the walls, the pot must be kashered in the same way that it absorbed the taste. This is the well-known principle: “as it absorbs, so it releases” (“ke-bole’o kakh polto”; Pesaḥim 30b). It is necessary to clarify that whenever the Sages spoke of taste absorbed into the kli, they also referred to taste that got stuck to the walls of the kli due to the strength of the cooking or the fire. It was only about two hundred years ago that a method for manufacturing soap, which can clean kelim thoroughly, was discovered. Prior to that, even when they tried to clean kelim using substances like lye and ash, whose effects are similar to that of soap, fatty residue of foods almost always remained stuck to the walls. In addition, since the walls were generally rougher, more taste adhered to them than nowadays. Thus, the directive of this mitzva, to kasher kelim in the manner by which they absorbed taste, refers to taste that adhered to and was absorbed into the walls of the kelim (as explained in detail in Peninei Halakha: Kashrut 32, n. 1).
Kashering kelim for Pesaḥ is just like kashering kelim after they were used for non-kosher food. To make them kosher for Pesaḥ, they must be kashered with the same methods by which they were used. Ḥametz utensils that one does not wish to make kosher for Pesaḥ must be cleaned normally and put away in a closed place so that nobody inadvertently uses them during Pesaḥ (SA 451:1; see also above 6:4, where we learned that such kelim should not be sold).