Anhedral and dihedral have no effect unless the aircraft is slipping. Whether one wing appears more or less parallel to the horizon is irrelevant. Lift is a function of angle of attack and relative airflow, and has nothing to do with earth reference.
If an aircraft is slipping, anhedral or dihedral will cause the wings to have different (asymmetric) angles of attack. Therefore there will be asymmetric lift across the wingspan, which will generate a rolling moment to bank into the slip (anhedral) or away from the slip (dihedral). Hence it is called lateral stability (stability in roll).
(That's an oversimplification. In practice, as someone has already said, many factors affect stability.)