Nanofiltration is a membrane filtration process that selectively separates molecules based on size and charge, typically used for water purification and wastewater treatment. It operates between ultrafiltration and reverse osmosis in terms of pore size, effectively removing multivalent ions and small organic molecules while allowing monovalent ions to pass through.