At its most basic, a discretionary bonus is a bonus paid out that has no specific criteria.
As an example - if an employer offers a Team Lead a bonus when her department's sales exceed 15% over the previous quarter, that is a work-related bonus. There is a specific criteria connected to the bonus, and the employer is obligated to pay the bonus if the criteria is met.
An increasing number of job offers and contracts include mention of a discretionary bonus as remuneration in addition to the employee's salary. This can put the employer and the employee in awkward positions: an employer of course does not need to pay the employee the bonus as there is no specific criteria or commitment, but the employee can come to expect it, especially if pre-determined goals are met.
Describing the bonus as "discretionary" will not always shield the employer from possible legal recourse should they fail to pay the employee. Should the bonus become an integral part of the employee's salary, for example, it ceases to be discretionary. If you offer an employee 60% of the market rate for their yearly salary but promise a discretionary bonus to make up for the difference (when it becomes more financially viable, perhaps), you may be obligated to pay it.
Dismissing an employee may not be grounds to deny a discretionary bonus, either. If dismissed during the period of bonus calculation, for example, the employee may be eligible for a pro-rated portion of the bonus. If they're dismissed even before the bonus calculation period, they may even be entitled to the historic average for that bonus. If an employee is dismissed after the calculation period but before the payout, they will certainly be entitled to receive the bonus.
There are a number of legal cases between employers and employees in Canadian history wherein the court has sided with the plaintiff in awarding a bonus, on occasion citing "fairness" as a reason. Just because a discretionary bonus is legally an "expectation" and not a right does not indemnify the employer.