Three reasons, and only one of them is margin.
The first is scope. One quote includes the tempering valve, the new drain line, the electrical work and disposal; the other assumes them away and finds them on the day. Compared side by side those look like the same job at different prices, and they are not the same job.
The second is what has been assumed about access. A quote written from a photograph has guessed at how the old unit comes out and the new one goes in. If that guess is wrong the price moves, and the person who guessed more carefully looks more expensive until the day arrives.
The third is the unit. Two systems of the same capacity can be different products with different warranties, different cylinder linings and different parts availability in five years. A cheaper unit is sometimes exactly the right call, but it should be a decision you made rather than one made for you.
The practical protection is a written quote that lists what is included, and asking about anything you cannot see on it. Any tradesman worth using will answer that without getting defensive.