Sometimes these may be leftovers from a lost technological civilization, or perhaps it could be that science developed along a different path than ours, allowing for more advanced technology in one field, while stagnating in others, but most of the time there is no explanation whatsoever for the bizarre mix of medieval and futuristic.