Tibialis Posterior
As you can see from the area of red above, I have been having pain in my medial ankle, just behind that bony prominence called the medial malleolus. I actually wasn't sure which tendon was inflamed and causing pain (always painted red in pain commercials) until I did a little web research. There are a lot of tendons that move around the ankle so it took me some time to identify which one was bothering me.
ANATOMY
Amazing thing about the tibialis posterior (or posterior tibialis) muscle is that it is located just posterior to the tibia bone and is innervated by the tibial nerve with blood supply from the posterior tibial artery, but we don't really care about that. We know that form follows function, so if we know where the muscle attaches then we can figure out what it does. It originates below the knee and under the big gastrocnemius calf muscle so you won't be able to see or feel this muscle at its proximal portion. The muscle then tapers down to a tendon that runs in that area of pain I have behind my medial ankle. Here it runs posterior to the medial malleolus in it's own sheath with a couple of other tendons that flex the toes (flexor digitorum longus and flexor hullicus longus) finally inserting on the bones that form the arch of the foot.
FUNCTION
Because it is located on the back of the lower leg and runs behind the medial malleolus, when the tibialis posterior contracts and shortens it will pull the foot down (called plantar flexion) and medial or inward (called inversion). Think about pointing your toes away from your nose and towards the other foot. You can see the opposite of this would be dorsiflexion (foot up towards nose) and eversion (toes away from midline). You can test your posterior tibialis function right now by standing up on your toes and then shifting your weight to the 4th and 5th toes. Dysfunction of this muscle leads to the opposite pictured above where the foot and ankle collapse inward. Flat feet could be named as the blame for this but that might be more of a chicken or the egg statement. Does a weak tibialis posterior lead to a flat everted foot posture? Or does flat feet overstress and weaken the tibialis posterior? I don't know the answer, nor do I really need to know. For this muscle to function properly the foot must be in neutral (correct) position to begin with (so you, and I, might need some shoe inserts to do this), then it needs to be correctly exercised to strengthen it to keep the foot in this proper neutral position.
As mentioned, probably the only time you will ever care about this muscle is when you have tendonitis. This is usually an overuse injury and is probably traced back to poor mechanics like your foot is chronically pronated. Good footwear, good posture, and some correcting/strengthening exercises below will probably be your best answer.