I managed people for a long time (not software developers but think some of this transfers).

At times well over 100 people with sub managers in some outfits. I did pretty well at it from a results perspective watching others who came before/after me. Here's some observations:

-People are emotional creatures. They will behave irrationally much of the time without realizing it. Everything isn't logical game theory when the rubber meets the road.

-People want to feel valued and not in a fake "You folks did a really good job" when everyone knows it isn't true way. They want to feel important and needed. It's something instinctive in the human psyche. You have to give people the space to become heros. Also you need people to feel what they are doing makes a difference to get the best out of them.

-Most people will put out given the situation allows them to do so. Some people very simply will not. Don't tolerate those few people and don't let it get started. Nothing threatens a team's morality like those not pulling their weight with no consequences. Also if someone plain isn't happy in their situation (and everyone has bad days and even weeks) it's time for a change. Helping those people make that change when it's needed resolves friction both for them and the organization.

-Ambiguity and complexity are mind killers. As a manager your job is to make the path forward simple and make sure the resources are available. People shouldn't have to doubt and guess much to do their jobs. That's your job. Fine grained and very clear tasks are best.

-Humility is key. And honesty. Also a leader that wants to be followed is on the front lines with a sword. Not slacking off in comfort and showing up periodically to upbraid or threaten. Not throwing his team members under the bus. The leader is ultimately responsible and lack of results fall on their shoulders.

-People have to feel fairly compensated and not taken advantage of to be "happily working". If these are missing in the org don't try to manage it, it's a shitshow revolving door and not somewhere you want to be. On the other hand money doesn't buy everything. People will do amazing things for reasons other then money.

-People have an innate sense of fairness dating back to our earliest times. You can be strict in your expectations, and in fact must be to have quality results. But if you have uneven expectations or don't subject yourself to the same standards moral goes out the window in a hurry. Never "pick on" a person. Try your best not to favor people. Don't get cliquish. Employees are not your friends in this context. But do everything in your power to help people working under you. It's easier if you don't go out drinking etc. with your employees. Keep your relationship at a professional level.

-A feeling of being a team is very powerful. Create this. But don't create a gang. It's not "us against upper management, other departments, irrational customers etc." The gang instinct is also powerful, and it can work for a bit, but it's a lie and ultimately harmful in the larger picture. Try to avoid negativity.

There's a lot more I could write. People are much more complex then say, dogs, but there are general stimuli people respond to and they can be induced in not dissimilar manner. But at the end of the day they also need to eat. It's not about "tricking" people or even "training" people (you train plants, you teach people and "training seminars" is an utterly abhorrent term).

It's a ton of work and stress effectively managing people. It made me very tired after some years and I just wanted to write code.