What can be the source of foot cramps?

Magnesium deficiency. A magnesium deficiency is one. Sometimes, it can be poor circulation (though less common), sometimes it depends on the activity, for example swimming often causes a foot cramp and this is because people don't tend to use the small muscles in the foot and all of a sudden they are getting overutilized and it causes a cramp.
Several. Dehtdration, overuse, improper arch support, tight shoes.