This is usually provided annually, and usually calculated as a percent of your base - which means if you negotiate a higher base, you automatically get a higher potential annual bonus. This is a calculation we do for you, by the way, and is why base improvements are even more beneficial than they seem.
Companies vary widely, typically a mix of individual and company performance. Individual performance is often rated on a simple scale and used as a multiplier. The multiplier is applied to the company outcomes to produce your actual bonus - for instance, a 150% multiplier on a 90% company performance result means you receive (1.5) x (0.9) x Target Bonus.
Company performance may be a single number, but is more often a combination of elements, and in tech companies may be a mix of financial and user metrics (revenue and profitability, for instance; and DAU or MAU growth rates).
It adds up to complex formulas, but most companies try to set these so that, in most years, the actual bonus payout for most employees is somewhere within 80-120% of what you would expect to achieve with standard performance.