Dan Ariely and other Psychology and Behavioral Economists claim that the value of bonuses is not big or even negative [0].
My experience is that bonuses tied to performance leads to a bad work environment, and if at all benefits only part of the people- the backstabbers or the geniuses [0] https://www.wired.co.uk/article/dan-ariely-bonuses-boost-act...
Bonuses can be done in almost an unlimited number of ways. You have to decide what are you rewarding, or why are you trying to give a bonus.
Some companies start paying bonuses to avoid raising salaries, this -can- be ok if the person is very senior and making a high salary already and so paying a bonus is a way to reward good work when the company is doing well without driving the persons salary so high they become unemployable anywhere else if they would choose to leave. This can be bad when companies pay bonuses to keep salaries artificially low for employees as a whole, it will backfire majorly.
Other companies pay bonuses to all employees based on seniority (time with the company & level of position) and do so as a profit share of sorts. This is very common at profitable businesses. I consulted at a business that was netting $10Million a year with 8 employees, even the admin assistant for that office was getting $20k+ bonuses in a quarter cause the owners treated everyone super well and as a side affect no one ever wanted to leave.
I also worked at a company where management had a bonus bool twice a year based on performance, 20% of all profits for the company were given to anyone at the manager level of above. This caused a lot of resentment from the engineers as they felt slighted since without them the company did have a product. Frankly while I was getting paid bonuses there I agreed with the engineers and the production people. They eventually went to a split bool, 20% to management, 10% to all employees, still felt a bit wrong in some ways but it made most people very happy.
I also worked at a software company where everyone made bonuses every quarter if your project/product was profitable. So there were teams that saw tiny bonuses of like $3-4k, while teams with more money coming in and more profit could see $40k bonuses. While logical, you can probably predict pretty fast what that can do to teams & a company.
So as for how to handle engineer bonuses. My 2 cents. If you pay bonuses make sure the process is clear to everyone and that people understand it is based on whatever factors you have chosen. With that, assuming the factors are fair and clear bonuses are almost never bad in my experience. The only bad ones are where bonuses are paid in order to avoid salary increases when people still have headroom on their salary based on industry norms (although there are a couple of exceptions here when in a startup and money is tighter).