Confidence is a constitutional convention within Commonweath realms and republics.
The principal constitutional function of the Crown (in Commonweath realms) or the President in Commonwealth republics is to ensure that there is always a Government in office, and that the Government is capable of functioning. Since Parliament controls supply, a Government can only function if it is capable of obtaining supply. For this reason, if a Government loses the "confidence" of the House, it can no longer function.
Obviously, under strict party discipline, a party with a majority of seats in the House is never vulnerable to a loss of confidence. (In practice there have been some blips due to absent members and miscalculations, but I can't recall any in majority situations).
Some matters are, by convention, always matters of confidence: votes on the Speech from the Throne (the speech that initiates a Parliamentary session, and sets out the Government's priorities), votes on supply (essential the budget, but can also include votes on supplementary estimates or economic updates). In addition, the Government can declare any matter before the House to be a confidence matter (essentially blackmailing a more numerous Opposition into allowing it to pass, otherwise, face an election). Finally, on an Opposition Day, an opposition member may propose a motion that, "This House does not have confidence in the Government." (or words of a similar, express effect).
There are then two options: a dissolution of Parliament triggering a general election, or an invitation to another member of the House to attempt to form a government. It is usually the Prime Minister's advice to dissolve, but the Crown is not legally bound to accept that advice. If, for example, a general election was recently held, and other parties can demonstrate that they will be able to form a stable government, then the Crown can call upon an opposition leader to attempt to form a government.
It is generally accepted in bicameral parliaments that confidence refers only to the will of the lower House. In the United Kingdom, the House of Lords has lacked the authority to block legislation since 1911 (it can only delay for two sessions). However, as recently as 1975, the Australian Senate's refusal to vote supply was sufficient to precipitate a constitutional crisis.
_________________
--James