As far as I see it, the kidney exists for one primary purpose: to filter the blood. That doesn't mean that the kidneys don't do anything else - on the contrary - but it does mean that at the heart of what they're doing is filtering. And of course, this means that when the kidneys stop working, one of the main things you'll notice is the mess that doesn't get filtered out.
Probably the second most important thing that the kidney does is production of certain chemicals - including the active form of Vitamin D, and the hormones renin and erythropoietin. These are discussed more in the article on the kidney.
As doctors, we're able to get a really good idea of how well the kidneys are working in a number of ways. Most simply, we can look at how much urine someone is peeing out. If they need to go to the toilet a lot, or are producing lots of urine, it may be because they're drinking plenty, but it may be because the kidneys are leaking. Similarly, if someone just stops producing urine, it's either because they're keeping hold of the water in the absence of anything to drink, or it might be because the kidneys have packed up and stopped working.
However, we also have a blood test called U&E (or Us and Es, short for urea and electrolytes) which looks at the levels of urea, creatinine, and certain electrolytes (sodium and potassium) to give an idea of how well the kidneys are working.
The kidney is a marvellous thing. It needs to be able to get rid of anything in the blood which shouldn't be there, so it starts by kicking everything out. Blood enters the kidney and makes its way to the glomerulus, where there is a tuft of capillaries surrounded by a capsule known as Bowman's space. The first thing to happen is that everything (well, about 20% of the plasma) is chucked out of the glomerulus into the Bowman's space.
Water can get through quite easily - and happily does. The water that you pass in your urine needs to get squeezed out of the blood in this way. However, there are lots of other things in your wee apart from water. These other molecules are also squeezed out from the blood in the glomerulus. Very small molecules - less than 4 nanometres in size - will squeeze out very easily; any neutral molecules that are up to 8nm big should be able to get through. This is because the barrier between the blood and Bowman's space is leaky. In normal kidneys, bigger molecules won't get through - because the barrier is only so leaky!
The basement membrane between the blood and Bowman's capsule has endothelium on one side and epithelium on the other. The endothelium is the wall of the blood vessel, and has holes (called fenestrations) in it. The epithelium is made up of podocytes, which have feet that form slits for things to filter through. Molecules therefore travel from the blood through the endothelium, basement membrane and podocytes to get into Bowman's space.
There are some proteins in the capillary wall which are negatively charged. Because opposites attract and same-things repel, things in the blood which have a positive charge will actually filter more than those things which are negative (or even neutral). On the other hand, things which are negative will actually filter through even less than neutral. Albumin is very important for staying in the blood to maintain the oncotic pressure, and because it is neutral, only a very small amount leaks into Bowman's capsule.
The blood vessel approaching the tuft is called the afferent arteriole; the one leaving it is the efferent arteriole. The pressure is kept high in the tuft of capillaries by the efferent arteriole, because the more it squeezes (in response to angiotensin II) the harder it is for blood to leave and the higher the pressure in the glomerulus.
It is hydrostatic pressure that the efferent arteriole controls - that is, it is hydrostatic pressure that forces plasma out of the capillary; however, osmotic pressure is going to have the opposite effect - the osmolarity of the blood will be higher than Bowman's capsule, pulling water back. Overall the hydrostatic pressure is high enough to force plasma out. However, as you work your way along the capillary, more water will be squeezed out while the big proteins are still in the capillary. Because there's less water now, the concentration of proteins and big molecules is higher, so the oncotic pressure goes up. Eventually the effect of oncotic pressure (pulling water in) and hydrostatic pressure (squeezing water out) is the same, and the water stays put inside the blood vessel.
Oncotic pressure and hydrostatic pressure usually reach this equilibrium before the end of the tuft of capillaries. This means that there is the potential for more to be filtered, if only the equilibrium hadn't yet been reached. One way this can be done is by increasing the blood flow - the blood moves through the capillary a bit faster, so the blood travels further before the oncotic pressure has risen enough to reach equilibrium. Although the same proportion of plasma has been squeezed out, more blood has come through the glomerulus so there's a bigger total amount that has been filtered.
Squeezing and relaxing the efferent arteriole is able to control the hydrostatic pressure in the glomerulus and make sure that it's right for filtration to happen; if anything is likely to change, the efferent arteriole can adjust in order to make sure the pressure is still ok for filtration to happen. However, if the mean arterial blood pressure (i.e. the average blood pressure) drops below 90mmHg, no amount of efferent squeezing is going to fix it - the amount that is filtered drops dramatically.
Other things which can reduce the amount that is filtered include a reduction in renal blood flow (obviously), or increasing the hydrostatic pressure in Bowman's capsule (e.g. by blocking the outflow of urine). Other things which can increase the amount that is filtered include changes in blood osmolarity (e.g. less protein in the blood, so equilibrium takes longer to reach), or increased leakiness of the capillaries (e.g. due to damage).
So, we've squeezed a significant amount of the plasma out of the blood into Bowman's capsule. What are we going to do with it? Well, the kidney is designed to regulate the concentrations of everything by squeezing 'everything' out, and then only absorbing those things which should be reabsorbed. So, as the stuff which has been squeezed out (the filtrate) moves along the nephron, a combination of biological transport mechanisms and simple diffusion make sure everything is at the right concentration.
The most important thing to understand before going into the specifics of this is the principle of how reabsorption works along the nephron. The nephron is made up of the tubule running through the interstitial fluid away from the glomerulus, and it is surrounded by tubule cells. Reabsorption takes place through the tubule cells. Good things which have been squeezed out into the filtrate are reabsorbed intot he tubule cells and then into the interstital fluid. Waste produce which needs to be removed from the interstitial fluid or tubule cells is excreted through the tubule cells into the tubule lumen. This principle is followed all the way down the nephron.
The tubule cells, then, act a bit like corridors for molecules to pass through. At each end of the tubule cell there are transporters to help molecules get into and out of the cell. If travelling into the cell means traveling from an area of high concentration to low concentration, it travels through simple diffusion. However, if it's going from low concentration to high concentration to low concentration, it takes energy to pump it across - usually in the form of ATP.
The first part of the nephron that the filtrate gets to after Bowman's capsule is the proximal tubule. This is surrounded by tubule cells with pumps on each side. The side closest to the tube is the apical or luminal surface; the side away from the tube is the basal surface.
It is in the proximal tubule that the first part of the reabsorption takes place. Sodium is one of the most important things to be reabsorbed, because a huge amount of it is squeezed out in the glomerulus, and its levels need to remain high in the blood. It's also important because it is key to creating osmotic pressure, and water follows it by osmosis. Other solutes like glucose and amino acids are reabsorbed in the proximal tubule, and they are cleverly transported with sodium by a co-transporter on the luminal surface. This sees that soduim is already moving into the tubule cell, and decides to join up the movement of sodium with the movement of something else. With all of this movement of solutes out of the tubule, water tends to follow by osmosis in order to keep the osmolarity inside the tubule the same.
The reason this is possible is because of the sodium-potassium pump on the other side of the cell, on the basal surface. This pump is furiously using up ATP to pump sodium out of the cell and potassium into the cell - something which takes a lot of energy because they are moving against their concentration gradients. However, by doing this, it keeps sodium in the cell low - which will mean that the sodium will want to get into the cell from the tubule lumen. All of the glucose and amino acids and other things coming into the cell rely on moving in with sodium, and that's only going to happen if this pump is working on the other side.
Meanwhile, since the glucose and other solutes are happily moving with sodium into the cell, a build up occurs which means they'll be transported out of the cell by simple diffusion using a transporter.
So, a sodium-potassium pump makes sure there is a strong sodium concentration gradient running from the lumen into the tubule cell, so sodium is pulled into the cell. Glucose and other solutes hitch a ride on co-transporters and are pulled into the cell, so their concentration builds up - and those solutes consequently pass into the interstitial fluid down their concentration gradients.
Since plasma is continuing to be pushed through the glomerulus, more filtrate is finding its way into the nephron. The filtrate moves down the nephron and beyond the proximal tubule, where the processes going on change, and we get into the section called the loop of Henle.
The loop of Henle is a clever part of the nephron which helps to absorb more of the water which has been filtered, and at the same time to make the filtrate less concentrated. It has a clever way of doing this by dipping down deep into the medulla and coming back up again in a deep loop. In fact, it's this loop part which makes the nephron so very tall. The two halves of the loop are slightly different - the first half leaks water into the surrounding interstitial fluid, and the second half actively pumps electrolytes like sodium and potassium into the surrounding fluid. The way that this is achieved is called a counter-current multiplier. Let me explain.
The main movement of electrolytes in this part of the nephron is in the second half of the loop. A sodium-potassium pump sets up a sodium gradient again which means that the sodium concentration in the tubule cells is lower than the sodium concentration in the filtrate. This time the co-transporter carries potassium and chloride with the sodium, and - just like before - the extra potassium and chloride are transported out of the cell at the other side using a transporter. Put most simply, electrolytes are pumped out of the lumen and into the interstitial fluid.
This is mainly happening in the second half of the loop. Because this bit is impermeable to water, this second half of the loop finds the concentration in the tubule going down. Things which are dissolved in the filtrate are pumped out but the water stays in, and the filtrate obviously becomes more dilute.
Indeed, the concentration of the filtrate gets lower the further up you go. This means that the amount of electrolytes which can be pumped out goes down - so more electrolytes are pumped at the bottom of the loop than at the top. Of course, this means that both the filtrate inside the tubule and the interstitial fluid which surrounds the tubule will be most concentrated at the bottom of the loop - where more electrolytes are being pumped out.
The first half of the loop does allow water to leak out - that is, it is permeable to water. As the tubule works its way down into the medulla, it travels into an area that is more and more concentrated, and water will leak out by osmosis to try and balance out the concentrations. In this first half of the loop, the concentration goes up the further along you go, because of this leaking water. The further down you go, the higher the concentration of the surrounding fluid, so the more water will leak out by osmosis, and the more concentrated the remaining filtrate will be.
All this leaking water would dilute the surrounding interstitial fluid, but the opposite side of the loop is continuing to pump electrolytes out of the filtrate, so the concentration of the interstitla fluid stays high. This concentration will always be highest at the bottom tip of the loop because this is where the most electrolytes are pumped out. While water continues to leak out of the first half of the loop, the second half of the loop is receiving a high concentration of electrolytes to pump back into the interstitial fluid - and more will be pumped out at the bottom than at the top.
We're now in a position to understand how the counter-current mechanism works. Filtrate going into the loop has an osmolarity of around 300 mOsm. As you go down the loop, this concentration goes up as water leaks into the surrounding fluid. At the tip of the loop, the osmolarity may be as high as 1200 mOsm. The filtrate then goes up the loop, and as the electrolytes are pumped out and the water stays in, the concentration comes back down again. Even though we've absorbed loads more water in the process, the fluid coming out at the end of the process is hypotonic (i.e. lower concentration than plasma) because of this counter-current mechanism.
Blood vessels travelling through the interstitial fluid could easily mess up this clever system, because the concentration of sodium and urea is so high at the tip of the loop that it could diffuse into the blood and get whisked away. This would ruin the concentration gradient which is so important for the system to work. However, the vasa recta blood vessels in this part of the kidney also have a counter-current system set up, so the water which leaks into the interstitial fluid is taken up again by the blood vessels before they leave.
Finally we come to the last two sections of the nephron: the distal (convoluted) tubule and the collecting ducts. These parts of the nephron continue the work which has been done so far in reabsorbing all of the good stuff out of the filtrate. However, the two parts work slightly differently.
In the same way as throughout the rest of the nephron, a sodium-potassium pump has set up a concentration gradient so that sodium wants to travel out of the lumen and into the tubule cell. This time the co-transporter carries sodium and chloride out of the lumen. The tubule at this point is only slightly permeable to water, so some water is reabsorbed out of the tubule - but not very much. The overall effect is that a small amount of water is reabsorbed, and a lot of sodium is reabsorbed, so the filtrate becomes more dilute.
In the last section, you find hormones like aldosterone and ADH are very important. Just like the sections which have come before, a sodium-potassium pump sets up a sodium gradient so that the sodium concentration inside the tubule cell is low, and sodium is pumped out of the lumen and into the surrounding fluid. Usually potassium will leak back into the interstitial fluid, but at this point in the nephron it can leak into the lumen. Of course, this isn't usually a problem, but if there is more sodium in the lumen at this point (e.g because the earlier pumps have been blocked), it may get swapped for potassium and you can leak potassium into the urine.
Aldosterone is particularly important at causing this last bit to happen, so if your aldosterone isn't working properly (e.g. in Addison's disease), you won't reabsorb your sodium and you won't get rid of your potassium properly. This leads to a low concentration of sodium in the blood and a high potassium.
The most important thing for understanding how the kidney affects the pH of blood is the carbonic acid equilibrium. If you don't understand that, you won't understand any of it! However, once you've got to grips with that, the rest of it starts to make sense.
Put most simply, the carbonic acid equilibrium shows that carbon acid can split up in two different ways. It can either split into carbon dioxide and water (both of which are neutral), or it can split up into a hydrogen ion and bicarbonate. The equilibrium shows that carbonic acid acts as a buffer - it can increase the acidity of blood by donating a hydrogen ion and leaving bicarbonate, or it can decrease the acidity of blood by combining bicarbonate and a hydrogen ion to form carbonic acid.
This means that the body can control the acidity of blood by shifting this equilibrium. The kidney will filter out a lot of bicarbonate into the nephron, so the best way that the kidney can control the acidity of blood is by changing the amount of bicarbonate it reabsorbs.
The first place that it does this is in the proximal tubule. As mentioned elsewhere, the proximal tubule is involved in reabsorbing certain solutes like glucose and amino acids, as well as reabsorbing sodium. However, this part of the nephron is also responsible for reabsorbing bicarbonate.
The first thing to remember is that hydrogen ions are secreted into the lumen all the way through the nephron. This means that the filtrate (and indeed urine) is normally going to be a bit more acidic than blood. It also means that any bicarbonate that is floating around can bind to the hydrogen ion to produce carbonic acid.
Carbonic acid cannot diffuse through membranes. However, carbon dioxide and water can. This means that the carbonic acid can get into the tubule cells simply by separating into carbon dioxide and water. These can then combine back together again once they have got inside the cell - and once we have carbonic acid inside the tubule cell, it can split up again into a hydrogen ion and bicarbonate. If this is the situation, then we have the opportunity to reabsorb some bicarbonate into the blood, if only there is a way of getting rid of that spare hydrogen ion.
We can get rid of that hydrogen in one of three ways. The first is the sodium-hydrogen exchanger on the luminal surface. This swaps sodium and hydrogen, pushing hydrogen ions back into the filtrate - and consequently getting rid of any spare ones floating around inside the tubule cell. The bicarbonate is then free to get reabsorbed into the blood using the sodium-bicarbonate co-transporter on the basal surface. This effect also happens in the ascending part of the loop of Henle.
The second way that we get rid of hydrogen is a very similar mechanism. There is an ATP-powered hydrogen pump on the luminal surface. It's not as important as the sodium-hydrogen exchanger, but it gets rid of hydrogen from the tubule cell by pushing it into the filtrate, and this frees up the bicarbonate to get reabsorbed. A hydrogen pump is also present in the collecting duct so that a similar thing can take place.
The third way that the hydrogen is disposed of is by getting involved in the disposal of ammonium. Although ammonia is toxic to humans, binding it to a hydrogen ion to give ammonium makes it safe. It can be transported around the body combined to glutamate to give glutamine, and then separated again in the kidney so that the ammonium can be pushed out into the urine using the sodium-hydrogen exchanger.
The remaining glutamate undergoes reactions in order to convert it into carbon dioxide or glucose, and it needs a spare hydrogen ion in order to successfully achieve these reactions. It can either steal this from the ammonium (leaving ammonia to diffuse into the filtrate) or it can steal this from the carbonic acid, leaving bicarbonate to get reabsorbed.
The kidney is therefore set up to use the carbonic acid equilibrium to control acidity. Even though loads of bicarbonate is pushed out into the filtrate, the kidney can reabsorb this bicarbonate. The more acidic the blood is, the more bicarbonate can be absorbed to act as a buffer and get rid of the spare hydrogen ions. The less acidic it is, the less bicarbonate needs to be reabsorbed to maintain the right blood pH. Clever, hey? By looking at the levels of bicarbonate in the blood, you can get a reasonably good idea of how hard the kidney is having to work to reabsorb it in order to keep the blood at the right pH; the more bicarbonate in the blood, the harder it is having to work.
By the end of the distal tubule, you've reabsorbed so much of the filtrate that you've hardly got any of it left. In fact, because you've absorbed more of the electrolytes and solutes than water, you're left with a very dilute (or hypotonic) contents. In order to avoid wasting all this water by throwing it out into the urine, the kidney has another go at reabsorbing it. This is done by releasing ADH or anti-diuretic hormone. I like to remember how it works by calling it anti-wee hormone, because it causes you to reabsorb water, making you wee less.
ADH acts in the collecting ducts, which is the bit after you've got to the end of the distal tubule. This is where all the nephrons feed into a series of tubes or ducts which ultimately lead out of the kidneys. These ducts don't let any water out of them when they're on their own, but when ADH comes along, it's a different story.
ADH acts on the cells to cause a protein called aquaporin-2 to get moved up to the luminal surface of the collecting duct cells. This is a special protein that causes water to move out of the collecting ducts and on into the interstitial fluid.
The effect of this is different depending on which part of the collecting duct you are in. Remember that because of the counter-current mechanism in the loop of Henle (explained elsewhere), the lower down you go, the higher the osmolarity of the interstitial fluid. So the cortex (high up) will have a reasonably low osmolarity, while the medulla (low down) will have a really high osmolarity.
So, if you put water channels (lots of aquaporin-2 proteins) into cells in the cortex, then some water is going to be reabsorbed, making the fluid about the same concentration as blood. However, if you put water channels in the medulla, then you're going to absorb loads of water - the interstitial fluid is so concentrated that it's crying out for water to dilute it!! This leads to a really concentrated urine - as much as five times the concentration of blood.
Diabetes inspidus is an interesting condition where the body either doesn't produce ADH, or it doesn't respond to it. This leads to an inability to concentrate urine - so you produce lots of urine, lose lots and lots of water, and get very dehydrated.