Well, as you may have seen on old films, books or museums, legs used to be just a stick tied to the leg, and made out of wood.
As we (humans) began to understand a little bit more about how the body works and we developed new technologies (metals and fabrication) the limbs became more and more sophisticated.
For example, until relatively quite recently, limbs were made of shaped aluminium in their majority. Aluminium is a relatively strong metal and it is great for conducting heat, so the users would have minimum sweating issues.
At the same time, having to shape metal by hand for each user is incredibly skilful and time-consuming, so the industry moved into more sophisticated methods such the legs could be mass produced in a modular system.
Techniques such Gait lab and even more traditional methods such as X-rays, to see where the bones are, and in general, more understanding of the parts of the body, have allowed us to be where we are at the moment.
Related to materials, well, industries such as aerospace and F1 have helped a lot to develop light and high-performance materials such as carbon fibre or sophisticated metal alloys.
So nowadays we are able to transfer technology from different industries.