Compare the functioning of alveoli in the lungs and nephrons in the kidneys with respect to their structure and functioning.