The primary function of an expansion valve is to control the flow of refrigerant from the high-pressure condensing side of the system into the low-pressure evaporator, achieving a pressure reduction through a variable flow orifice, either modulating or two-position. This allows the refrigerant to expand and change state from liquid to vapor, enabling the heat transfer process in the evaporator.