Because of a strange, non-intuitive, and little-known quirk of the law, while everything employees do on the job is owned by their employer, the result is different in the case of independent contractors. Independent contractors own the copyright to any copyrightable works that they create, even though someone else is paying them.
This is known to HR departments and employment lawyers, so any business with the least amount of sophistication will require any independent contractor to sign an agreement signing away all of those intellectual property rights to the employer (technically the client).
However, an unsophisticated client, such as a consumer hiring a photographer, does not know about this, so we often come across the case where a consumer (such as a woman who hired someone to photograph her wedding) is outraged when she discovers that her photographer won’t give her the digital files that she thought she had paid for and was entitled to.
If I were hiring a photographer, I would be sure to give the photographer a contract stating that I own all rights to the digital files, and anyone who refused to sign I would tell to screw off.
I would think that photographers who value their customer relationships would give their customers those files, including the intellectual property rights, even when the customer isn’t wise enough to insist on that beforehand, but it seems like a lot of professional photographers don’t agree with that because they feel like they make greater profit from the pricing model that leaves the customer feeling like they were ripped off.