Lactose reduces over time in aged cheese because bacteria in the cheese break down the lactose and convert it into lactic acid.
During the cheesemaking process, most of the lactose is removed by straining out the whey. The remaining lactose is then broken down by bacteria. The longer the cheese ages, the more time the bacteria have to consume the lactose.
In general, harder cheeses have lower lactose levels. Well-aged cheeses like Parmesan, Pecorino Romano, Cheddar, Manchego, Asiago, Swiss, Havarti, or Gruyere contain little or no lactose.
Fresh cheeses like ricotta, goat, mascarpone, cream, cottage, and feta do not undergo aging and still contain lactose.