I can’t speak for all immigration lawyers or all immigration law firms, but based on personal experience, I can shed some insight on the topic. First of all, immigration lawyers determine their fees based on the complexity of the case in question.
Not all immigration cases are the same. Some can be quite complex such as in cases of political asylum, while some can be quite direct, like filing a certain type of visa application. In some of these cases, an immigration attorney may charge a flat fee that reflects the relative ease of the case, while in some other cases, they will charge an hourly rate.
The attorney’s experience level is another factor in determining how much they charge, and additional services such as case evaluations, document preparation and filling, representation at hearings and interviews, etc., are other key factors.
The resources here helped me a lot on the topic, and maybe it can help you too: https://www.litwinlaw.com/immigration-overview/