Rambam codifies the rule that the law of the kingdom is law and applies it to taxes, tolls, and land-related royal claims. He distinguishes legitimate royal taxation from extortion or theft.
בַּמֶּה דְּבָרִים אֲמוּרִים שֶׁהַמּוֹכֵס כְּלִסְטִים בִּזְמַן שֶׁהַמּוֹכֵס עַכּוּ"ם אוֹ מוֹכֵס הָעוֹמֵד מֵאֵלָיו אוֹ מוֹכֵס הָעוֹמֵד מֵחֲמַת הַמֶּלֶךְ וְאֵין לוֹ קִצְבָה אֶלָּא לוֹקֵחַ מַה שֶּׁיִּרְצֶה וּמֵנִיחַ מַה שֶּׁיִּרְצֶה. אֲבָל מֶכֶס שֶׁפְּסָקוֹ הַמֶּלֶךְ וְאָמַר שֶׁיִּקַּח שְׁלִישׁ אוֹ רְבִיעַ אוֹ דָּבָר קָצוּב וְהֶעֱמִיד מוֹכֵס יִשְׂרָאֵל לִגְבּוֹת חֵלֶק זֶה לַמֶּלֶךְ וְנוֹדַע שֶׁאָדָם זֶה נֶאֱמָן וְאֵינוֹ מוֹסִיף כְּלוּם עַל מַה שֶּׁגָּזַר הַמֶּלֶךְ אֵינוֹ בְּחֶזְקַת גַּזְלָן לְפִי שֶׁדִּין הַמֶּלֶךְ דִּין הוּא. וְלֹא עוֹד אֶלָּא שֶׁהוּא עוֹבֵר הַמַּבְרִיחַ מִמֶּכֶס זֶה מִפְּנֵי שֶׁהוּא גּוֹזֵל מְנַת הַמֶּלֶךְ בֵּין שֶׁהָיָה הַמֶּלֶךְ עַכּוּ"ם בֵּין שֶׁהָיָה הַמֶּלֶךְ יִשְׂרָאֵל: וְכֵן מֶלֶךְ שֶׁמֵּשִׂים מַס עַל בְּנֵי הָעִיר אוֹ עַל כָּל אִישׁ וְאִישׁ דָּבָר קָצוּב מִשָּׁנָה לְשָׁנָה אוֹ עַל כָּל שָׂדֶה וְשָׂדֶה דָּבָר קָצוּב. אוֹ שֶׁגָּזַר שֶׁכָּל מִי שֶׁיַּעֲבֹר עַל דָּבָר זֶה יִלָּקְחוּ כָּל נְכָסָיו לְבֵית הַמֶּלֶךְ. אוֹ כָּל מִי שֶׁיִּמָּצֵא בַּשָּׂדֶה בִּשְׁעַת הַגֹּרֶן הוּא יִתֵּן הַמַּס שֶׁעָלֶיהָ בֵּין שֶׁהָיָה הוּא בַּעַל הַשָּׂדֶה בֵּין שֶׁאֵינוֹ בַּעַל הַשָּׂדֶה וְכָל כַּיּוֹצֵא מִדְּבָרִים אֵלּוּ אֵינוֹ גֵּזֶל וְיִשְׂרָאֵל שֶׁגָּבָה אוֹתָן לַמֶּלֶךְ אֵינוֹ בְּחֶזְקַת גַּזְלָן וַהֲרֵי הוּא כָּשֵׁר. וְהוּא שֶׁלֹּא יוֹסִיף וְלֹא יְשַׁנֶּה וְלֹא יִקַּח לְעַצְמוֹ כְּלוּם: כְּלָלוֹ שֶׁל דָּבָר כָּל דִּין שֶׁיַּחְקֹק אוֹתוֹ הַמֶּלֶךְ לַכּל וְלֹא יִהְיֶה לְאָדָם אֶחָד בִּפְנֵי עַצְמוֹ אֵינוֹ גֵּזֶל. וְכָל שֶׁיִּקַּח מֵאִישׁ זֶה בִּלְבַד שֶׁלֹּא כַּדָּת הַיְדוּעָה לַכּל אֶלָּא חָמַס אֶת זֶה הֲרֵי זֶה גֵּזֶל. לְפִיכָךְ גַּבָּאֵי הַמֶּלֶךְ וְשׁוֹטְרָיו שֶׁמּוֹכְרִים הַשָּׂדוֹת בְּמַס הַקָּצוּב עַל הַשָּׂדוֹת מִמְכָּרָן מִמְכָּר. אֲבָל מַס שֶׁעַל כָּל אִישׁ וְאִישׁ אֵינוֹ גּוֹבֶה אֶלָּא מִן הָאָדָם עַצְמוֹ וְאִם מָכְרוּ הַשָּׂדֶה בְּמַס שֶׁעַל הָרֹאשׁ הֲרֵי זֶה אֵינוֹ מִמְכָּר אֶלָּא אִם כֵּן הָיָה דִּין הַמֶּלֶךְ כָּךְ:
When does the statement that a customs-collector is considered to be a highwayman apply? When the customs collector is a gentile, is self-appointed, or was appointed by the king but is given unlimited jurisdiction and takes whatever he wants and leaves whatever he wants. If, however, the customs-collector was appointed by the king to take a third, a fourth or any fixed amount of the subjects' goods or their value, the customs collector appoints a Jew to collect this sum for the king, and it is known that this person is faithful and does not add anything beyond what the king decreed, this person is not considered a robber. For the law established by the king is binding law. Indeed, anyone who does not pay this tax transgresses, for he is taking what is due the king. This applies whether the king is Jewish or gentile. Similarly, if a king imposes a tax on all the inhabitants of a city, a fixed annual head tax or a fixed annual property tax, or decrees that anyone who violates a particular law will have all his property confiscated by the king, or decrees that anyone who is found in a field at the harvest time must pay the tax on it whether or not he is the owner of the field, or any similar decree, it is not considered to be robbery. A Jew who collects these duties on behalf of the king is not considered to be a robber. On the contrary, he is considered of upright character, provided he does not add to or change the king's levy in any way, nor take any for himself. The general principle is: Any law that a king decrees to be universally applicable, and not merely applying to one person, is not considered robbery. But whenever he takes from one person alone in a manner that does not conform to a known law, but rather seizes the property from the person arbitrarily, it is considered to be robbery. Therefore, when the king's tax collectors and enforcement officers sell fields because the owner did not pay the fixed tax for the field, the sale is binding. A head tax, however, is the personal responsibility of each person and it may not be collected from his property. Thus, if a field was sold because an individual was delinquent in paying the head tax, the sale is not binding, unless this is the law enacted by this particular king.