Gratuity is based on your basic salary, not your total package. That trips a lot of people up — allowances for housing, transport, or a car aren't part of the calculation, only the basic salary line on your contract.
The formula rewards longer service more than proportionally: 21 days' pay per year for the first five years, then 30 days' pay for every year after that. Someone with eight years in gets a noticeably better rate on years six through eight than they did on year one.
There's a cap, too — total gratuity can't exceed two years' worth of salary, no matter how long you've worked. It rarely matters unless you're well past a decade with the same employer.
One edge case worth knowing about: Article 44 lets an employer withhold gratuity entirely in specific gross-misconduct dismissal cases. It's not common, but it's the reason two people with identical salaries and tenure can end up with different payouts.