Was the king the most powerful person in medieval times?

yes