Enclosed systems function by using barriers, often made from biocompatible or chemically inert materials, to encapsulate active agents. These barriers can be engineered to degrade or open in response to specific stimuli, such as pH changes, temperature shifts, or the presence of certain enzymes. This allows for precise control over the release of the encapsulated substances.