Firstly, this is something that's going to vary depending on the company and the rules they've got in place. The larger the company, the greater the chance that there's a whole lot of rules in place that confine a manager's choices on the matter of salary. You also have to break down what you mean by salary...are you talking offer letters or raises, because the two are often entirely separate concerns.

I can give you my own perspective as someone who's managed at a very large company, which will give you an idea of some of the lunacy and arbitrariness of how salaries were determined. First, there's offers that we extended. For hiring, managers were given a headcount number, not a budget. This led to most managers trying to hire as senior talent as they could find until they were told no (i.e. you're maxed out on Principal- and Staff-level engineers). However they could always get as many Senior-level engineers as they wanted, so very few managers ever hired I's and II's. When offers were extended, a lot depended on the desired salary of the candidate and the salaries we were allowed to offer for their designation. This is where the dance with the recruiter makes a difference. People unskilled in that and/or unaware of their worth would come in low on the "let's just see if we're in the right ballpark" number and get lowballed in the offer and there was very little a manager could do about that. People who came in high got preemptively booted from the interview process. Once offers had gone out, there were a couple of ways things could go. Either the candidate was expecting a lot more and took something else, the candidate accepted, or the candidate pushed back. How they pushed back is interesting...H1-Bs would almost never negotiate on salary, but would want the faster EB-2 visa process whereas citizens would push for more money or stock. Occasionally, there was an exceptional candidate who would push for more money than was allowed in the salary band for their intended designation (i.e. SWII can make up to $130k and the candidate wanted $145k). In those cases, we'd almost always simply bump their designation to one with a higher band if we were allowed to.

However the hiring process was remarkably sane in comparison with the process for giving out raises. Raises were limited to a degree that I always felt bad about not being able to keep pace with the market rate for developers. Almost always, if there were two developers at the same level, the one with the fewer years of experience would be earning a higher base salary. The one who'd been there longer would almost certainly get more RSUs, but that compensation is intended to reward you, not make you whole, so it seemed like the base salaries should have been more consistent too. The way that raises were limited was a formula based on 3 ratings that we'd have to give each of our direct reports. We'd then have a large meeting where managers defended their ratings to calibrate across the business unit. At the end of calibrations, there were quotas our business unit could not exceed for the higher ratings, so we were often forced to lower someone's rating simply because we had too many good people. Once ratings had been hashed out and approved by upper management, each employee would be given a range of percentage increases that we could assign without needing approval. However the overall increase for our entire teams couldn't exceed a certain percentage. Think of it like a MMORPG...you've got a certain amount of gold to spend and you have to decide how to strategically deploy it in such a way as to maximize productivity overall, only you never have enough gold. It was possible to request a one-time adjustment which would have to be cleared by upper management, but those were rarely approved without a really good reason.

That's a long-winded explanation, but I think the overall takeaways are:
1) It can be a Kafkaesque process where it's easy for what people are paid and why they're being paid that to become almost entirely disconnected. Filling out those forms was somewhat like filling out your taxes. You put in some numbers and the software spit out a resulting number based on logic that was rarely comprehensible.
2) The initial setting of salary and the adjustments are almost entirely separate and it's really hard to adjust salaries after the fact. We had people quit and get rehired because it was simpler to adjust pay that way.
3) Researching your own worth is super important...a little time on GlassDoor or otherwise figuring out what you're worth can really pay off in the long run, since you'll correctly set your initial salary.
4) At the end of the day, managers are human. All things being equal, I gave higher ratings and more money to the people who created fewer problems for me and helped keep the rest of the team productive. Whether it was scheduling a return flight from a vacation on Monday morning and then coming into work that day or letting your phone die so you couldn't answer late night pages...all that stuff got remembered and the people who maintained their professionalism and made my life easier got the better raises.

I hope this helps answer your question.