My guess - it's probably a combination of things. Amount of time baby spends nursing daily and how long baby has been nursing, 6mos, 1yr, 18mos, etc. Mom's body just spent 9 months providing everything baby needed, so it only makes sense that we are already programed for each baby's needs. Mother's hormones also play a part (bm usually changes it mom gets pregnant while nursing), but I believe that the baby can also effects mom's hormones (no proof, just a personal belief).
I can't attest to milk composition when I was nursing, but my flow increased considerably as ds got older and his suck got stronger. I have been told by people on this board, that just does NOT happen, but I watched it happen. In fact, as my flow increased we had to change the nipple on his bottles to match my flow, he would get really upset when the bottle was too slow, but as soon as we went up a size, he was happy. About every 3 months the sitter was poking new holes in the nipples until I got new ones. With ds#1 who was only bottle fed we never had to switch the nipple size.
Now the question: Did baby effect the changes or do the changes just happen and baby just adapts or maybe both? I'll guess both.