The Romans did not have a tax system as we know it.
Each year, companies would bid on the contract to collect taxes from the provinces (Romans were not taxed, not at first, only the foreign provinces). Whatever company bid the highest tax revenue was awarded the contract for that year.
The tax companies then collected taxes in whatever ways they found convenient. They had market taxes (every merchant pays a fee); they had city-gate taxes (anyone bringing-in goods to sell had to pay a fee). They had real estate taxes, where landowners paid a tax based on the value of the property. They had border taxes where merchants entering the province had to pay a certain amount or a percentage of their goods’ value. They could tax ships coming or going. They could have toll roads or bridges. They had all kinds of taxes.
The Roman government did not care “how” the tax collectors got the money. They only cared that they met their goal for the year; and anything left over was their profit. They cared only if the tax collectors were too harsh and caused trouble or rebellion. Naturally, they didn’t like that.
That’s why tax collectors get such a harsh treatment in the Gospels. As long as they paid what the government wanted, they were permitted to keep whatever was surplus—that was the whole point.