The process involves passing the liquid or gas through a membrane that has tiny pores. These pores trap and remove contaminants, including bacteria, viruses, and other microorganisms, while allowing the filtered fluid to pass through. The pore size of the membrane is critical, as it determines the level of filtration and the types of contaminants that can be removed.