Potting, casting and encapsulation are the preferred processes today to protect or completely seal sensitive products, like e.g. electronics or filter components.
The function or reason of a casted or encapsulated product may vary a lot, depending on the nature of product, the final use, etc. Sometimes it is simple protection from dust and moist, sometimes it is an enhencement of functionalities, sometimes it is a formed seal.
Similar like in bonding and sealing applications, the materials are specifically designed to meet the final requirements of the product. Casting resins like silicones, polyurethanes or epoxies are precisely metered into a component to fill the complete housing or applied onto the surface.