In the first case they are paid the same as someone with a higher title, and when promoted inevitably they will be paid more than someone with the same title.
In the second case they are paid more than people with their same title who may be performing all of the duties required, and this is not to say that there are not others also performing equivalently who did not received this equivalent wage.
This sort of situation is exactly why people need to talk to their manager, to avoid over performing and being resentful about it. The fact the person was able to get a raise without a promotion is literally the best case scenario. If their work is actually the same they’ll be promoted and get another raise, resulting in higher pay than those with the same title…